Mercurial > code > home > repos > light9
changeset 1883:17bee25a20cb
reformat
Ignore-this: 9392ba9c775fe3c5997496ddfe598f09
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Tue, 28 May 2019 06:46:08 +0000 |
parents | 5c1b662c0263 |
children | 5cde72dfdc22 |
files | bin/keyboardcomposer light9/FlyingFader.py light9/Submaster.py light9/dmxclient.py light9/effecteval/effectloop.py light9/gtkpyconsole.py light9/showconfig.py light9/tkdnd.py light9/uihelpers.py light9/vidref/musictime.py tasks.py |
diffstat | 11 files changed, 31 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/keyboardcomposer Tue May 28 06:42:27 2019 +0000 +++ b/bin/keyboardcomposer Tue May 28 06:46:08 2019 +0000 @@ -113,11 +113,11 @@ self.namelabel.pack(side=tk.TOP) self.levellabel = tk.Label(self, - textvariable=self.slider_var, - font="Arial 6", - bg='black', - fg='white', - pady=0) + textvariable=self.slider_var, + font="Arial 6", + bg='black', + fg='white', + pady=0) self.levellabel.pack(side=tk.TOP) self.scale.pack(side=tk.BOTTOM, expand=1, fill=tk.BOTH) @@ -133,7 +133,7 @@ def getVal(self) -> float: return self._val - + def setVal(self, newVal: float) -> None: if self.scale is None: return @@ -189,11 +189,11 @@ self.setVal(graph.value(setting, L9['level']).toPython()) finally: self.pauseTrace = False - + def updateName(self): if self.scale is None: return - + def shortUri(u): return '.../' + u.split('/')[-1] @@ -532,8 +532,9 @@ row['bg'] = 'black' def get_levels(self): - return dict([(uri, box.getVal()) - for uri, box in list(self.subbox.items())]) + return dict([ + (uri, box.getVal()) for uri, box in list(self.subbox.items()) + ]) def get_output_settings(self, _graph=None): _graph = _graph or self.graph
--- a/light9/FlyingFader.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/FlyingFader.py Tue May 28 06:46:08 2019 +0000 @@ -1,6 +1,7 @@ from tkinter import tix from time import time + class Mass: def __init__(self):
--- a/light9/Submaster.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/Submaster.py Tue May 28 06:46:08 2019 +0000 @@ -73,7 +73,7 @@ # not sure how useful this is if not isinstance(other, Submaster): return -1 - return cmp(self.ident(), other.ident()) # noqa + return cmp(self.ident(), other.ident()) # noqa def __hash__(self): return hash(self.ident())
--- a/light9/dmxclient.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/dmxclient.py Tue May 28 06:46:08 2019 +0000 @@ -72,5 +72,5 @@ if dummy: print("dmxclient: DMX is in dummy mode.") - def outputlevels(*args, **kw): # noqa + def outputlevels(*args, **kw): # noqa pass
--- a/light9/effecteval/effectloop.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/effecteval/effectloop.py Tue May 28 06:46:08 2019 +0000 @@ -69,7 +69,8 @@ old = now - self.requestTime if old > self.coastSecs: try: - r = yield treq.get(networking.musicPlayer.path('time'), timeout=.5) + r = yield treq.get(networking.musicPlayer.path('time'), + timeout=.5) response = yield r.json_content() except TimeoutError: log.warning("TimeoutError: using stale time from %.1f ago", old)
--- a/light9/gtkpyconsole.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/gtkpyconsole.py Tue May 28 06:46:08 2019 +0000 @@ -1,5 +1,5 @@ from lib.ipython_view import IPythonView -import gi # noqa +import gi # noqa from gi.repository import Gtk from gi.repository import Pango
--- a/light9/showconfig.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/showconfig.py Tue May 28 06:46:08 2019 +0000 @@ -58,9 +58,10 @@ if not name: raise ValueError("Song %r has no :songFilename" % song) - return path.abspath(path.join( - cast(Literal, root).toPython(), - cast(Literal, name).toPython())) + return path.abspath( + path.join( + cast(Literal, root).toPython(), + cast(Literal, name).toPython())) def songFilenameFromURI(uri: URIRef) -> bytes:
--- a/light9/tkdnd.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/tkdnd.py Tue May 28 06:46:08 2019 +0000 @@ -2,6 +2,7 @@ from os.path import join, basename from typing import Dict, Any + class TkdndEvent(object): """ see http://www.ellogon.org/petasis/tcltk-projects/tkdnd/tkdnd-man-page
--- a/light9/uihelpers.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/uihelpers.py Tue May 28 06:46:08 2019 +0000 @@ -143,7 +143,7 @@ low = (80, 80, 180) high = (255, 55, 0o50) out = [int(l + lev * (h - l)) for h, l in zip(high, low)] - col = "#%02X%02X%02X" % tuple(out) # type: ignore + col = "#%02X%02X%02X" % tuple(out) # type: ignore label.config(bg=col) @@ -151,7 +151,7 @@ def colorfade(low, high, percent): '''not foolproof. make sure 0 < percent < 1''' out = [int(l + percent * (h - l)) for h, l in zip(high, low)] - col = "#%02X%02X%02X" % tuple(out) # type: ignore + col = "#%02X%02X%02X" % tuple(out) # type: ignore return col
--- a/light9/vidref/musictime.py Tue May 28 06:42:27 2019 +0000 +++ b/light9/vidref/musictime.py Tue May 28 06:46:08 2019 +0000 @@ -126,10 +126,10 @@ def sendTime(self, t): """request that the player go to this time""" - treq.post(networking.musicPlayer.path('time'), - data=json.dumps({ - "t": time - }).encode('utf8'), - headers={b"content-type": [b"application/json"]}, + treq.post( + networking.musicPlayer.path('time'), + data=json.dumps({ + "t": time + }).encode('utf8'), + headers={b"content-type": [b"application/json"]}, ) -
--- a/tasks.py Tue May 28 06:42:27 2019 +0000 +++ b/tasks.py Tue May 28 06:46:08 2019 +0000 @@ -47,7 +47,7 @@ # run([src])# + pkg_sources()) @task def reformat(ctx): - ctx.run("env/bin/yapf --verbose --parallel --in-place --style google light9/**/*.py `file --no-pad bin/* | grep 'Python script' | perl -lpe 's/:.*//'`") + ctx.run("env/bin/yapf --verbose --parallel --in-place --style google light9/*.py light9/*/*.py `file --no-pad bin/* | grep 'Python script' | perl -lpe 's/:.*//'`") @task def test(ctx):