diff bin/effecteval @ 1866:3c523c71da29

pyflakes cleanups and some refactors Ignore-this: f7372e678699175feb4e628eee3d768c
author Drew Perttula <drewp@bigasterisk.com>
date Sat, 25 May 2019 12:10:51 +0000
parents 40cc863d2b63
children d01e21621975
line wrap: on
line diff
--- a/bin/effecteval	Sat May 25 12:06:01 2019 +0000
+++ b/bin/effecteval	Sat May 25 12:10:51 2019 +0000
@@ -4,7 +4,7 @@
 from twisted.internet import reactor
 from twisted.internet.defer import inlineCallbacks, returnValue
 import cyclone.web, cyclone.websocket, cyclone.httpclient
-import sys, optparse, logging, subprocess, json, itertools
+import sys, optparse, logging, json, itertools
 from rdflib import URIRef, Literal
 
 sys.path.append('/usr/lib/pymodules/python2.7/')  # for numpy, on rpi
@@ -20,6 +20,7 @@
 from greplin import scales
 
 from cycloneerr import PrettyErrorHandler
+from light9.coffee import StaticCoffee
 
 
 class EffectEdit(PrettyErrorHandler, cyclone.web.RequestHandler):
@@ -201,9 +202,9 @@
 
     def get(self):
         song = URIRef(self.get_argument('song'))
-        effects = effectsForSong(self.settings.graph, song)
+        effects = effectsForSong(self.settings.graph, song) # noqa
         raise NotImplementedError
-        self.write(maxDict(effectDmxDict(e) for e in effects))
+        self.write(maxDict(effectDmxDict(e) for e in effects)) # noqa
         # return dmx dict for all effects in the song, already combined
 
 
@@ -259,19 +260,6 @@
         log.info("listening on %s" % networking.effectEval.port)
 
 
-class StaticCoffee(PrettyErrorHandler, cyclone.web.RequestHandler):
-
-    def initialize(self, src):
-        super(StaticCoffee, self).initialize()
-        self.src = src
-
-    def get(self):
-        self.set_header('Content-Type', 'application/javascript')
-        self.write(
-            subprocess.check_output(
-                ['/usr/bin/coffee', '--compile', '--print', self.src]))
-
-
 if __name__ == "__main__":
     parser = optparse.OptionParser()
     parser.add_option(