changeset 1877:d01e21621975

reformat Ignore-this: 94923ca49bff97013722c14471a5134c
author Drew Perttula <drewp@bigasterisk.com>
date Mon, 27 May 2019 07:41:09 +0000
parents 8da5b4edcb7e
children bee1c0747242
files bin/collector bin/effecteval bin/keyboardcomposer light9/collector/collector_client.py light9/collector/weblisteners.py light9/effect/sequencer.py light9/effect/settings.py light9/effect/simple_outputs.py light9/vidref/musictime.py
diffstat 9 files changed, 26 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/bin/collector	Mon May 27 07:03:27 2019 +0000
+++ b/bin/collector	Mon May 27 07:41:09 2019 +0000
@@ -29,7 +29,6 @@
 from light9.collector.output import EnttecDmx, Udmx, DummyOutput  # noqa
 
 
-
 class Updates(cyclone.websocket.WebSocketHandler):
 
     def connectionMade(self, *args, **kwargs):
--- a/bin/effecteval	Mon May 27 07:03:27 2019 +0000
+++ b/bin/effecteval	Mon May 27 07:41:09 2019 +0000
@@ -202,9 +202,9 @@
 
     def get(self):
         song = URIRef(self.get_argument('song'))
-        effects = effectsForSong(self.settings.graph, song) # noqa
+        effects = effectsForSong(self.settings.graph, song)  # noqa
         raise NotImplementedError
-        self.write(maxDict(effectDmxDict(e) for e in effects)) # noqa
+        self.write(maxDict(effectDmxDict(e) for e in effects))  # noqa
         # return dmx dict for all effects in the song, already combined
 
 
--- a/bin/keyboardcomposer	Mon May 27 07:03:27 2019 +0000
+++ b/bin/keyboardcomposer	Mon May 27 07:41:09 2019 +0000
@@ -181,14 +181,19 @@
 
 class KeyboardComposer(tk.Frame, SubClient):
 
-    def __init__(self, root: tk.Tk, graph: SyncedGraph, session: URIRef, hw_sliders=True):
+    def __init__(self,
+                 root: tk.Tk,
+                 graph: SyncedGraph,
+                 session: URIRef,
+                 hw_sliders=True):
         tk.Frame.__init__(self, root, bg='black')
         SubClient.__init__(self)
         self.graph = graph
         self.session = session
 
         self.subbox: Dict[URIRef, SubmasterBox] = {}  # sub uri : SubmasterBox
-        self.slider_table: Dict[Tuple[int, int], SubmasterBox] = {}  # coords : SubmasterBox
+        self.slider_table: Dict[Tuple[int, int], SubmasterBox] = {
+        }  # coords : SubmasterBox
         self.rows: List[tk.Frame] = []  # this holds Tk Frames for each row
 
         self.current_row = 0  # should come from session graph
--- a/light9/collector/collector_client.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/collector/collector_client.py	Mon May 27 07:41:09 2019 +0000
@@ -11,6 +11,7 @@
 
 
 class TwistedZmqClient(object):
+
     def __init__(self, service):
         zf = ZmqFactory()
         e = ZmqEndpoint('connect', 'tcp://%s:%s' % (service.host, service.port))
--- a/light9/collector/weblisteners.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/collector/weblisteners.py	Mon May 27 07:41:09 2019 +0000
@@ -1,6 +1,7 @@
 import logging, traceback, time, json
 log = logging.getLogger('weblisteners')
 
+
 class WebListeners(object):
 
     def __init__(self):
--- a/light9/effect/sequencer.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/effect/sequencer.py	Mon May 27 07:41:09 2019 +0000
@@ -56,7 +56,8 @@
                 self.getCurvePoints(curve, L9['strength'], originTime))
         self.points.sort()
 
-    def getCurvePoints(self, curve, attr, originTime) -> List[Tuple[float, float]]:
+    def getCurvePoints(self, curve, attr,
+                       originTime) -> List[Tuple[float, float]]:
         points = []
         po = list(self.graph.predicate_objects(curve))
         if dict(po).get(L9['attr'], None) != attr:
@@ -131,7 +132,9 @@
 
 class Sequencer(object):
 
-    def __init__(self, graph: SyncedGraph, sendToCollector: Callable[[DeviceSettings], None],
+    def __init__(self,
+                 graph: SyncedGraph,
+                 sendToCollector: Callable[[DeviceSettings], None],
                  fps=40):
         self.graph = graph
         self.fps = fps
--- a/light9/effect/settings.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/effect/settings.py	Mon May 27 07:41:09 2019 +0000
@@ -12,6 +12,7 @@
 from light9.collector.device import resolve
 from typing import Sequence, Dict, Union, List
 
+
 def parseHex(h):
     if h[0] != '#': raise ValueError(h)
     return [int(h[i:i + 2], 16) for i in (1, 3, 5)]
@@ -24,7 +25,7 @@
 def toHex(rgbFloat: Sequence[float]) -> str:
     assert len(rgbFloat) == 3
     scaled = (max(0, min(255, int(v * 255))) for v in rgbFloat)
-    return '#%02x%02x%02x' % tuple(scaled) # type: ignore
+    return '#%02x%02x%02x' % tuple(scaled)  # type: ignore
 
 
 def getVal(graph, subj):
@@ -43,7 +44,8 @@
 
     def __init__(self, graph, settingsList):
         self.graph = graph  # for looking up all possible attrs
-        self._compiled: Dict[URIRef, Dict[URIRef, Union[float, str]]] = {}  # dev: { attr: val }; val is number or colorhex
+        self._compiled: Dict[URIRef, Dict[URIRef, Union[float, str]]] = {
+        }  # dev: { attr: val }; val is number or colorhex
         for row in settingsList:
             self._compiled.setdefault(row[0], {})[row[1]] = row[2]
         # self._compiled may not be final yet- see _fromCompiled
--- a/light9/effect/simple_outputs.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/effect/simple_outputs.py	Mon May 27 07:41:09 2019 +0000
@@ -4,13 +4,15 @@
 from typing import Dict, List, Tuple, Any
 from rdflib import URIRef
 
+
 class SimpleOutputs(object):
 
     def __init__(self, graph):
         self.graph = graph
 
         # effect : [(dev, attr, value, isScaled)]
-        self.effectOutputs: Dict[URIRef, List[Tuple[URIRef, URIRef, Any, bool]]] = {}
+        self.effectOutputs: Dict[URIRef, List[
+            Tuple[URIRef, URIRef, Any, bool]]] = {}
 
         self.graph.addHandler(self.updateEffectsFromGraph)
 
--- a/light9/vidref/musictime.py	Mon May 27 07:03:27 2019 +0000
+++ b/light9/vidref/musictime.py	Mon May 27 07:41:09 2019 +0000
@@ -126,6 +126,8 @@
         fetch(
             method=b'POST',
             url=networking.musicPlayer.path('time'),
-            postdata=json.dumps({"t": t}).encode('utf8'),
+            postdata=json.dumps({
+                "t": t
+            }).encode('utf8'),
             headers={b"content-type": [b"application/json"]},
         )