changeset 1860:5bcb950024af

reformat python Ignore-this: 7bbe37d199612c9c74ef2904c3f13553
author drewp@bigasterisk.com
date Wed, 22 May 2019 00:09:13 +0000
parents f066d6e874db
children 40cc863d2b63
files bin/bumppad bin/collector bin/curvecalc bin/dmxserver bin/effecteval bin/keyboardcomposer bin/lightsim bin/paintserver bin/subcomposer bin/tracker light9/collector/collector.py light9/collector/collector_client.py light9/collector/device.py light9/collector/output.py light9/curvecalc/client.py light9/curvecalc/curve.py light9/curvecalc/curveview.py light9/curvecalc/zoomcontrol.py light9/effect/effecteval.py light9/effect/scale.py light9/effect/sequencer.py light9/effect/settings.py light9/effect/simple_outputs.py light9/effecteval/effectloop.py light9/io/__init__.py light9/io/udmx.py light9/paint/solve.py light9/paint/solve_test.py light9/vidref/replay.py
diffstat 29 files changed, 22 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/bin/bumppad	Wed May 22 00:08:22 2019 +0000
+++ b/bin/bumppad	Wed May 22 00:09:13 2019 +0000
@@ -55,7 +55,8 @@
         self.master.after_idle(self.output)
 
     def output(self):
-        dmx = sub_maxes(*[s * l for s, l in list(self.levs.items())]).get_dmx_list()
+        dmx = sub_maxes(*[s * l
+                          for s, l in list(self.levs.items())]).get_dmx_list()
         dmxclient.outputlevels(dmx, clientid="bumppad")
 
 
--- a/bin/collector	Wed May 22 00:08:22 2019 +0000
+++ b/bin/collector	Wed May 22 00:09:13 2019 +0000
@@ -7,7 +7,6 @@
 Input can be over http or zmq.
 """
 
-
 from run_local import log
 
 from rdflib import URIRef, Literal
--- a/bin/curvecalc	Wed May 22 00:08:22 2019 +0000
+++ b/bin/curvecalc	Wed May 22 00:09:13 2019 +0000
@@ -9,7 +9,6 @@
 
 """
 
-
 import sys
 import imp
 sys.path.append('/usr/lib/python2.7/dist-packages')  # For gtk
@@ -413,7 +412,8 @@
             ('input time', lambda t: "%.2fs" % t),
             ('output levels', lambda levels: textwrap.fill(
                 "; ".join([
-                    "%s:%.2f" % (n, v) for n, v in list(levels.items())[:2] if v > 0
+                    "%s:%.2f" % (n, v) for n, v in list(levels.items())[:2] if v
+                    > 0
                 ]), 70)),
             ('update period', lambda t: "%.1fms" % (t * 1000)),
             ('update status', lambda x: str(x)),
--- a/bin/dmxserver	Wed May 22 00:08:22 2019 +0000
+++ b/bin/dmxserver	Wed May 22 00:09:13 2019 +0000
@@ -24,7 +24,6 @@
   if parport fails, run in dummy mode (and make an option for that too)
 """
 
-
 from twisted.internet import reactor
 from twisted.web import xmlrpc, server
 import sys, time, os
@@ -127,7 +126,7 @@
             lastseen = self.lastseen[cid]
             if lastseen < now - purge_age:
                 print(("forgetting client %s (no activity for %s sec)" %
-                      (cid, purge_age)))
+                       (cid, purge_age)))
                 try:
                     del self.clientlevels[cid]
                 except KeyError:
@@ -184,8 +183,8 @@
 
     def printlevels(self):
         """write all the levels to stdout"""
-        print("Levels:", "".join(
-            ["% 2d " % (x * 100) for x in self.combinedlevels]))
+        print("Levels:",
+              "".join(["% 2d " % (x * 100) for x in self.combinedlevels]))
 
     def printstats(self):
         """print the clock, freq, etc, with a \r at the end"""
--- a/bin/effecteval	Wed May 22 00:08:22 2019 +0000
+++ b/bin/effecteval	Wed May 22 00:09:13 2019 +0000
@@ -1,6 +1,5 @@
 #!bin/python
 
-
 from run_local import log
 from twisted.internet import reactor
 from twisted.internet.defer import inlineCallbacks, returnValue
--- a/bin/keyboardcomposer	Wed May 22 00:08:22 2019 +0000
+++ b/bin/keyboardcomposer	Wed May 22 00:09:13 2019 +0000
@@ -1,6 +1,5 @@
 #!bin/python
 
-
 from run_local import log
 import cgi, time, logging
 from optparse import OptionParser
@@ -501,9 +500,8 @@
         row['bg'] = 'black'
 
     def get_levels(self):
-        return dict([
-            (uri, box.slider_var.get()) for uri, box in list(self.subbox.items())
-        ])
+        return dict([(uri, box.slider_var.get())
+                     for uri, box in list(self.subbox.items())])
 
     def get_output_settings(self, _graph=None):
         _graph = _graph or self.graph
--- a/bin/lightsim	Wed May 22 00:08:22 2019 +0000
+++ b/bin/lightsim	Wed May 22 00:09:13 2019 +0000
@@ -1,6 +1,5 @@
 #!bin/python
 
-
 import run_local
 import sys, logging
 
--- a/bin/paintserver	Wed May 22 00:08:22 2019 +0000
+++ b/bin/paintserver	Wed May 22 00:09:13 2019 +0000
@@ -1,6 +1,5 @@
 #!bin/python
 
-
 from run_local import log
 import json
 from twisted.internet import reactor
--- a/bin/subcomposer	Wed May 22 00:08:22 2019 +0000
+++ b/bin/subcomposer	Wed May 22 00:09:13 2019 +0000
@@ -16,7 +16,6 @@
 
 """
 
-
 from run_local import log
 import time, logging
 
@@ -161,8 +160,8 @@
         graph = self.graph
 
         def ann():
-            print("currently: session=%s currentSub=%r _currentChoice=%r" % (
-                self.session, self.currentSub(), self._currentChoice()))
+            print("currently: session=%s currentSub=%r _currentChoice=%r" %
+                  (self.session, self.currentSub(), self._currentChoice()))
 
         @graph.addHandler
         def graphChanged():
--- a/bin/tracker	Wed May 22 00:08:22 2019 +0000
+++ b/bin/tracker	Wed May 22 00:09:13 2019 +0000
@@ -1,6 +1,5 @@
 #!/usr/bin/python
 
-
 import sys
 sys.path.append("../../editor/pour")
 sys.path.append("../light8")
--- a/light9/collector/collector.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/collector/collector.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import time
 import logging
 from rdflib import Literal
--- a/light9/collector/collector_client.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/collector/collector_client.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from light9 import networking
 from light9.effect.settings import DeviceSettings
 from twisted.internet import defer
--- a/light9/collector/device.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/collector/device.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import logging
 import math
 from light9.namespaces import L9, RDF, DEV
--- a/light9/collector/output.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/collector/output.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from rdflib import URIRef
 import sys
 import time
--- a/light9/curvecalc/client.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/curvecalc/client.py	Wed May 22 00:09:13 2019 +0000
@@ -12,8 +12,10 @@
                                  method='POST',
                                  timeout=1,
                                  postdata=urllib.parse.urlencode({
-                                     'curve': curve,
-                                     'value': str(value),
+                                     'curve':
+                                     curve,
+                                     'value':
+                                     str(value),
                                  }))
 
     @f.addCallback
--- a/light9/curvecalc/curve.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/curvecalc/curve.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import glob, time, logging, ast, os
 from bisect import bisect_left, bisect
 import louie as dispatcher
--- a/light9/curvecalc/curveview.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/curvecalc/curveview.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import math, logging, traceback
 from gi.repository import Gtk
 from gi.repository import Gdk
@@ -555,8 +554,8 @@
 
     def print_state(self, msg=""):
         if 0:
-            print("%s: dragging_dots=%s selecting=%s" % (
-                msg, self.dragging_dots, self.selecting))
+            print("%s: dragging_dots=%s selecting=%s" %
+                  (msg, self.dragging_dots, self.selecting))
 
     def select_points(self, pts):
         """set selection to the given point values (tuples, not indices)"""
--- a/light9/curvecalc/zoomcontrol.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/curvecalc/zoomcontrol.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from gi.repository import Gtk
 from gi.repository import GObject
 from gi.repository import GooCanvas
--- a/light9/effect/effecteval.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effect/effecteval.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from rdflib import URIRef, Literal
 from light9.namespaces import L9, RDF, DEV
 from webcolors import rgb_to_hex, hex_to_rgb
--- a/light9/effect/scale.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effect/scale.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from rdflib import Literal
 from decimal import Decimal
 from webcolors import rgb_to_hex, hex_to_rgb
--- a/light9/effect/sequencer.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effect/sequencer.py	Wed May 22 00:09:13 2019 +0000
@@ -2,7 +2,6 @@
 copies from effectloop.py, which this should replace
 '''
 
-
 from louie import dispatcher
 from rdflib import URIRef
 from twisted.internet import reactor
--- a/light9/effect/settings.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effect/settings.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 """
 Data structure and convertors for a table of (device,attr,value)
 rows. These might be effect attrs ('strength'), device attrs ('rx'),
--- a/light9/effect/simple_outputs.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effect/simple_outputs.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import traceback
 from light9.namespaces import L9, RDF
 from light9.effect.scale import scale
--- a/light9/effecteval/effectloop.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/effecteval/effectloop.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import time, json, logging, traceback
 import numpy
 import serial
@@ -182,8 +181,9 @@
                 self.lastLogTime = now
 
     def logMessage(self, out):
-        return ("send dmx: {%s}" % ", ".join(
-            "%r: %.3g" % (str(k), v) for k, v in list(out.get_levels().items())))
+        return ("send dmx: {%s}" %
+                ", ".join("%r: %.3g" % (str(k), v)
+                          for k, v in list(out.get_levels().items())))
 
 
 Z = numpy.zeros((50, 3), dtype=numpy.float16)
--- a/light9/io/__init__.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/io/__init__.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import sys
 
 
--- a/light9/io/udmx.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/io/udmx.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import logging
 import usb.core
 from usb.util import CTRL_TYPE_VENDOR, CTRL_RECIPIENT_DEVICE, CTRL_OUT
--- a/light9/paint/solve.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/paint/solve.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 from light9.namespaces import RDF, L9, DEV
 from PIL import Image
 import numpy
--- a/light9/paint/solve_test.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/paint/solve_test.py	Wed May 22 00:09:13 2019 +0000
@@ -69,7 +69,7 @@
             settings=DeviceSettings(self.graph, [(
                 DEV['aura1'], L9['color'],
                 "#ffffff"), (DEV['aura1'], L9['rx'],
-                              0.5), (DEV['aura1'], L9['ry'], 0.573)]))
+                             0.5), (DEV['aura1'], L9['ry'], 0.573)]))
         self.assertEqual([{
             'path': CAM_TEST['bg2-d.jpg'],
             'color': (1., 1., 1.)
@@ -80,7 +80,7 @@
             settings=DeviceSettings(self.graph, [(
                 DEV['aura1'], L9['color'],
                 "#304050"), (DEV['aura1'], L9['rx'],
-                              0.5), (DEV['aura1'], L9['ry'], 0.573)]))
+                             0.5), (DEV['aura1'], L9['ry'], 0.573)]))
         self.assertEqual([{
             'path': CAM_TEST['bg2-d.jpg'],
             'color': (.188, .251, .314)
--- a/light9/vidref/replay.py	Wed May 22 00:08:22 2019 +0000
+++ b/light9/vidref/replay.py	Wed May 22 00:09:13 2019 +0000
@@ -1,4 +1,3 @@
-
 import os, gtk, shutil, logging, time
 from bisect import bisect_left
 from decimal import Decimal