diff --git a/bin/bumppad b/bin/bumppad --- a/bin/bumppad +++ b/bin/bumppad @@ -55,7 +55,8 @@ class pad(tk.Frame): 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") diff --git a/bin/collector b/bin/collector --- a/bin/collector +++ b/bin/collector @@ -7,7 +7,6 @@ custom code for some attributes. Input can be over http or zmq. """ - from run_local import log from rdflib import URIRef, Literal diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -9,7 +9,6 @@ todo: curveview should preserve more obj """ - import sys import imp sys.path.append('/usr/lib/python2.7/dist-packages') # For gtk @@ -413,7 +412,8 @@ class Main(object): ('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)), diff --git a/bin/dmxserver b/bin/dmxserver --- a/bin/dmxserver +++ b/bin/dmxserver @@ -24,7 +24,6 @@ todo: 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 @@ class XMLRPCServe(xmlrpc.XMLRPC): 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 @@ class XMLRPCServe(xmlrpc.XMLRPC): 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""" diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -1,6 +1,5 @@ #!bin/python - from run_local import log from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue diff --git a/bin/keyboardcomposer b/bin/keyboardcomposer --- a/bin/keyboardcomposer +++ b/bin/keyboardcomposer @@ -1,6 +1,5 @@ #!bin/python - from run_local import log import cgi, time, logging from optparse import OptionParser @@ -501,9 +500,8 @@ class KeyboardComposer(tk.Frame, SubClie 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 diff --git a/bin/lightsim b/bin/lightsim --- a/bin/lightsim +++ b/bin/lightsim @@ -1,6 +1,5 @@ #!bin/python - import run_local import sys, logging diff --git a/bin/paintserver b/bin/paintserver --- a/bin/paintserver +++ b/bin/paintserver @@ -1,6 +1,5 @@ #!bin/python - from run_local import log import json from twisted.internet import reactor diff --git a/bin/subcomposer b/bin/subcomposer --- a/bin/subcomposer +++ b/bin/subcomposer @@ -16,7 +16,6 @@ subcomposer """ - from run_local import log import time, logging @@ -161,8 +160,8 @@ class Subcomposer(tk.Frame): 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(): diff --git a/bin/tracker b/bin/tracker --- a/bin/tracker +++ b/bin/tracker @@ -1,6 +1,5 @@ #!/usr/bin/python - import sys sys.path.append("../../editor/pour") sys.path.append("../light8") diff --git a/light9/collector/collector.py b/light9/collector/collector.py --- a/light9/collector/collector.py +++ b/light9/collector/collector.py @@ -1,4 +1,3 @@ - import time import logging from rdflib import Literal diff --git a/light9/collector/collector_client.py b/light9/collector/collector_client.py --- a/light9/collector/collector_client.py +++ b/light9/collector/collector_client.py @@ -1,4 +1,3 @@ - from light9 import networking from light9.effect.settings import DeviceSettings from twisted.internet import defer diff --git a/light9/collector/device.py b/light9/collector/device.py --- a/light9/collector/device.py +++ b/light9/collector/device.py @@ -1,4 +1,3 @@ - import logging import math from light9.namespaces import L9, RDF, DEV diff --git a/light9/collector/output.py b/light9/collector/output.py --- a/light9/collector/output.py +++ b/light9/collector/output.py @@ -1,4 +1,3 @@ - from rdflib import URIRef import sys import time diff --git a/light9/curvecalc/client.py b/light9/curvecalc/client.py --- a/light9/curvecalc/client.py +++ b/light9/curvecalc/client.py @@ -12,8 +12,10 @@ def sendLiveInputPoint(curve, value): method='POST', timeout=1, postdata=urllib.parse.urlencode({ - 'curve': curve, - 'value': str(value), + 'curve': + curve, + 'value': + str(value), })) @f.addCallback diff --git a/light9/curvecalc/curve.py b/light9/curvecalc/curve.py --- a/light9/curvecalc/curve.py +++ b/light9/curvecalc/curve.py @@ -1,4 +1,3 @@ - import glob, time, logging, ast, os from bisect import bisect_left, bisect import louie as dispatcher diff --git a/light9/curvecalc/curveview.py b/light9/curvecalc/curveview.py --- a/light9/curvecalc/curveview.py +++ b/light9/curvecalc/curveview.py @@ -1,4 +1,3 @@ - import math, logging, traceback from gi.repository import Gtk from gi.repository import Gdk @@ -555,8 +554,8 @@ class Curveview(object): 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)""" diff --git a/light9/curvecalc/zoomcontrol.py b/light9/curvecalc/zoomcontrol.py --- a/light9/curvecalc/zoomcontrol.py +++ b/light9/curvecalc/zoomcontrol.py @@ -1,4 +1,3 @@ - from gi.repository import Gtk from gi.repository import GObject from gi.repository import GooCanvas diff --git a/light9/effect/effecteval.py b/light9/effect/effecteval.py --- a/light9/effect/effecteval.py +++ b/light9/effect/effecteval.py @@ -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 diff --git a/light9/effect/scale.py b/light9/effect/scale.py --- a/light9/effect/scale.py +++ b/light9/effect/scale.py @@ -1,4 +1,3 @@ - from rdflib import Literal from decimal import Decimal from webcolors import rgb_to_hex, hex_to_rgb diff --git a/light9/effect/sequencer.py b/light9/effect/sequencer.py --- a/light9/effect/sequencer.py +++ b/light9/effect/sequencer.py @@ -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 diff --git a/light9/effect/settings.py b/light9/effect/settings.py --- a/light9/effect/settings.py +++ b/light9/effect/settings.py @@ -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'), diff --git a/light9/effect/simple_outputs.py b/light9/effect/simple_outputs.py --- a/light9/effect/simple_outputs.py +++ b/light9/effect/simple_outputs.py @@ -1,4 +1,3 @@ - import traceback from light9.namespaces import L9, RDF from light9.effect.scale import scale diff --git a/light9/effecteval/effectloop.py b/light9/effecteval/effectloop.py --- a/light9/effecteval/effectloop.py +++ b/light9/effecteval/effectloop.py @@ -1,4 +1,3 @@ - import time, json, logging, traceback import numpy import serial @@ -182,8 +181,9 @@ class EffectLoop(object): 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) diff --git a/light9/io/__init__.py b/light9/io/__init__.py --- a/light9/io/__init__.py +++ b/light9/io/__init__.py @@ -1,4 +1,3 @@ - import sys diff --git a/light9/io/udmx.py b/light9/io/udmx.py --- a/light9/io/udmx.py +++ b/light9/io/udmx.py @@ -1,4 +1,3 @@ - import logging import usb.core from usb.util import CTRL_TYPE_VENDOR, CTRL_RECIPIENT_DEVICE, CTRL_OUT diff --git a/light9/paint/solve.py b/light9/paint/solve.py --- a/light9/paint/solve.py +++ b/light9/paint/solve.py @@ -1,4 +1,3 @@ - from light9.namespaces import RDF, L9, DEV from PIL import Image import numpy diff --git a/light9/paint/solve_test.py b/light9/paint/solve_test.py --- a/light9/paint/solve_test.py +++ b/light9/paint/solve_test.py @@ -69,7 +69,7 @@ class TestSimulationLayers(unittest.Test 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 @@ class TestSimulationLayers(unittest.Test 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) diff --git a/light9/vidref/replay.py b/light9/vidref/replay.py --- a/light9/vidref/replay.py +++ b/light9/vidref/replay.py @@ -1,4 +1,3 @@ - import os, gtk, shutil, logging, time from bisect import bisect_left from decimal import Decimal