annotate bin/effecteval @ 1860:5bcb950024af

reformat python Ignore-this: 7bbe37d199612c9c74ef2904c3f13553
author drewp@bigasterisk.com
date Wed, 22 May 2019 00:09:13 +0000
parents f066d6e874db
children 40cc863d2b63
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
1 #!bin/python
1593
6059de6659c3 move effects/ page into web/. fix homepage list. rm old subserver code.
Drew Perttula <drewp@bigasterisk.com>
parents: 1581
diff changeset
2
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
3 from run_local import log
1053
9937e2e3d17b effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents: 1052
diff changeset
4 from twisted.internet import reactor
9937e2e3d17b effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents: 1052
diff changeset
5 from twisted.internet.defer import inlineCallbacks, returnValue
1027
a38414bd3929 hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents: 1019
diff changeset
6 import cyclone.web, cyclone.websocket, cyclone.httpclient
1556
61f3f378cc62 move code for adding effect to current song to its own (testable) module
Drew Perttula <drewp@bigasterisk.com>
parents: 1548
diff changeset
7 import sys, optparse, logging, subprocess, json, itertools
1051
be016cd5e5c5 effecteval names its new curve after the sub you drop on it
Drew Perttula <drewp@bigasterisk.com>
parents: 1044
diff changeset
8 from rdflib import URIRef, Literal
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
9
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
10 sys.path.append('/usr/lib/pymodules/python2.7/') # for numpy, on rpi
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
11 sys.path.append('/usr/lib/python2.7/dist-packages') # For numpy
1556
61f3f378cc62 move code for adding effect to current song to its own (testable) module
Drew Perttula <drewp@bigasterisk.com>
parents: 1548
diff changeset
12 from light9 import networking, showconfig
1079
fce46850ed8c consolidate the curve load/save rdf code more
Drew Perttula <drewp@bigasterisk.com>
parents: 1076
diff changeset
13 from light9.effecteval.effect import EffectNode
1560
e993c5e1df1a fix effecteval to drop notes into new-style timeline
Drew Perttula <drewp@bigasterisk.com>
parents: 1559
diff changeset
14 from light9.effect.edit import getMusicStatus, songNotePatch
1115
818275850003 effecteval screens for only the kinds of outputs that it can send, so i can run a second instance just for LEDs
Drew Perttula <drewp@bigasterisk.com>
parents: 1114
diff changeset
15 from light9.effecteval.effectloop import makeEffectLoop
1079
fce46850ed8c consolidate the curve load/save rdf code more
Drew Perttula <drewp@bigasterisk.com>
parents: 1076
diff changeset
16 from light9.greplin_cyclone import StatsForCyclone
1556
61f3f378cc62 move code for adding effect to current song to its own (testable) module
Drew Perttula <drewp@bigasterisk.com>
parents: 1548
diff changeset
17 from light9.namespaces import L9
1692
6fa4288da8a6 rdfdb is its own package now
drewp@bigasterisk.com
parents: 1593
diff changeset
18 from rdfdb.patch import Patch
6fa4288da8a6 rdfdb is its own package now
drewp@bigasterisk.com
parents: 1593
diff changeset
19 from rdfdb.syncedgraph import SyncedGraph
1053
9937e2e3d17b effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents: 1052
diff changeset
20 from greplin import scales
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
21
1060
473db8bebb8f install a copy of cycloneerr.py
Drew Perttula <drewp@bigasterisk.com>
parents: 1055
diff changeset
22 from lib.cycloneerr import PrettyErrorHandler
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
23
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
24
1054
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
25 class EffectEdit(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
26
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
27 def get(self):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
28 self.set_header('Content-Type', 'text/html')
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
29 self.write(open("light9/effecteval/effect.html").read())
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
30
1054
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
31 def delete(self):
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
32 graph = self.settings.graph
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
33 uri = URIRef(self.get_argument('uri'))
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
34 with graph.currentState(tripleFilter=(None, L9['effect'], uri)) as g:
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
35 song = ctx = list(g.subjects(L9['effect'], uri))[0]
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
36 self.settings.graph.patch(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
37 Patch(delQuads=[
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
38 (song, L9['effect'], uri, ctx),
1054
4595a82f5a90 effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents: 1053
diff changeset
39 ]))
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
40
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
41
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
42 @inlineCallbacks
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
43 def currentSong():
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
44 s = (yield getMusicStatus())['song']
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
45 if s is None:
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
46 raise ValueError("no current song")
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
47 returnValue(URIRef(s))
1187
102a456be7db refactor EE moving towards the ability to re-bump existing curves
drewp@bigasterisk.com
parents: 1181
diff changeset
48
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
49
1044
a2081b9adfe4 effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents: 1043
diff changeset
50 class SongEffects(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
51
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
52 def wideOpenCors(self):
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
53 self.set_header('Access-Control-Allow-Origin', '*')
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
54 self.set_header('Access-Control-Allow-Methods',
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
55 'GET, PUT, POST, DELETE, OPTIONS')
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
56 self.set_header('Access-Control-Max-Age', '1000')
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
57 self.set_header('Access-Control-Allow-Headers',
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
58 'Content-Type, Authorization, X-Requested-With')
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
59
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
60 def options(self):
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
61 self.wideOpenCors()
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
62 self.write('')
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
63
1180
6c4981f61bf8 subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents: 1141
diff changeset
64 @inlineCallbacks
1044
a2081b9adfe4 effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents: 1043
diff changeset
65 def post(self):
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
66 self.wideOpenCors()
1076
dc474426845d effecteval better logging. everyone put their curve files in the right place.
Drew Perttula <drewp@bigasterisk.com>
parents: 1064
diff changeset
67 dropped = URIRef(self.get_argument('drop'))
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
68
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
69 try:
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
70 song = URIRef(self.get_argument('uri'))
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
71 except Exception: # which?
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
72 song = yield currentSong()
1556
61f3f378cc62 move code for adding effect to current song to its own (testable) module
Drew Perttula <drewp@bigasterisk.com>
parents: 1548
diff changeset
73
1558
7eb3676b8fd6 more of the fixed add-to-song service
Drew Perttula <drewp@bigasterisk.com>
parents: 1557
diff changeset
74 event = self.get_argument('event', default='default')
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
75
1566
13e3cbe9071a momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents: 1560
diff changeset
76 note = self.get_argument('note', default=None)
13e3cbe9071a momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents: 1560
diff changeset
77 if note is not None:
13e3cbe9071a momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents: 1560
diff changeset
78 note = URIRef(note)
13e3cbe9071a momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents: 1560
diff changeset
79
1181
c677bf37a1b4 effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents: 1180
diff changeset
80 log.info("adding to %s", song)
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
81 note, p = yield songNotePatch(self.settings.graph,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
82 dropped,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
83 song,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
84 event,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
85 ctx=song,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
86 note=note)
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
87
1557
104ff4606565 cleanup. internal names in edit.py
Drew Perttula <drewp@bigasterisk.com>
parents: 1556
diff changeset
88 self.settings.graph.patch(p)
1581
30c79f1dc4f8 fix suggestPrefixes to send suggestions to rdfdb
Drew Perttula <drewp@bigasterisk.com>
parents: 1570
diff changeset
89 self.settings.graph.suggestPrefixes(song, {'song': URIRef(song + '/')})
1566
13e3cbe9071a momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents: 1560
diff changeset
90 self.write(json.dumps({'note': note}))
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
91
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
92
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
93 class SongEffectsUpdates(cyclone.websocket.WebSocketHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
94
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
95 def connectionMade(self, *args, **kwargs):
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
96 self.graph = self.settings.graph
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
97 self.graph.addHandler(self.updateClient)
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
98
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
99 def updateClient(self):
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
100 # todo: abort if client is gone
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
101 playlist = self.graph.value(showconfig.showUri(), L9['playList'])
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
102 songs = list(self.graph.items(playlist))
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
103 out = []
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
104 for s in songs:
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
105 out.append({'uri': s, 'label': self.graph.label(s)})
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
106 out[-1]['effects'] = [{
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
107 'uri': uri,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
108 'label': self.graph.label(uri)
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
109 } for uri in sorted(self.graph.objects(s, L9['effect']))]
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
110 self.sendMessage({'songs': out})
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
111
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
112
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
113 class EffectUpdates(cyclone.websocket.WebSocketHandler):
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
114 """
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
115 stays alive for the life of the effect page
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
116 """
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
117
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
118 def connectionMade(self, *args, **kwargs):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
119 log.info("websocket opened")
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
120 self.uri = URIRef(self.get_argument('uri'))
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
121 self.sendMessage({'hello': repr(self)})
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
122
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
123 self.graph = self.settings.graph
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
124 self.graph.addHandler(self.updateClient)
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
125
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
126 def updateClient(self):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
127 # todo: if client has dropped, abort and don't get any more
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
128 # graph updates
1108
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
129
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
130 # EffectNode knows how to put them in order. Somehow this is
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
131 # not triggering an update when the order changes.
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
132 en = EffectNode(self.graph, self.uri)
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
133 codeLines = [c.code for c in en.codes]
4b542d321c8f effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents: 1107
diff changeset
134 self.sendMessage({'codeLines': codeLines})
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
135
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
136 def connectionLost(self, reason):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
137 log.info("websocket closed")
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
138
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
139 def messageReceived(self, message):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
140 log.info("got message %s" % message)
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
141 # write a patch back to the graph
1101
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
142
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
143
1107
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
144 def replaceObjects(graph, c, s, p, newObjs):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
145 patch = graph.getObjectPatch(context=c,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
146 subject=s,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
147 predicate=p,
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
148 newObject=newObjs[0])
1107
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
149
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
150 moreAdds = []
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
151 for line in newObjs[1:]:
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
152 moreAdds.append((s, p, line, c))
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
153 fullPatch = Patch(delQuads=patch.delQuads,
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
154 addQuads=patch.addQuads + moreAdds)
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
155 graph.patch(fullPatch)
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
156
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
157
1101
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
158 class Code(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
159
1101
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
160 def put(self):
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
161 effect = URIRef(self.get_argument('uri'))
1107
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
162 codeLines = []
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
163 for i in itertools.count(0):
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
164 k = 'codeLines[%s][text]' % i
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
165 v = self.get_argument(k, None)
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
166 if v is not None:
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
167 codeLines.append(Literal(v))
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
168 else:
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
169 break
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
170 if not codeLines:
1111
8842f0c7a641 refactor effectloop
Drew Perttula <drewp@bigasterisk.com>
parents: 1108
diff changeset
171 log.info("no codelines received on PUT /code")
1107
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
172 return
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
173 with self.settings.graph.currentState(tripleFilter=(None, L9['effect'],
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
174 effect)) as g:
1859
f066d6e874db 2to3 with these fixers: all idioms set_literal
drewp@bigasterisk.com
parents: 1858
diff changeset
175 song = next(g.subjects(L9['effect'], effect))
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
176
1107
512381de45bd effectclasss in subserver. multiline code suppport (except for evaulation). add some old effect funcs to the new evaluator
Drew Perttula <drewp@bigasterisk.com>
parents: 1103
diff changeset
177 replaceObjects(self.settings.graph, song, effect, L9['code'], codeLines)
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
178
1103
771f50f19b4b single-line effect code now evals by changing <uri> into a suitable python object
Drew Perttula <drewp@bigasterisk.com>
parents: 1101
diff changeset
179 # right here we could tell if the code has a python error and return it
1101
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
180 self.send_error(202)
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
181
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
182
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
183 class EffectEval(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
184
1027
a38414bd3929 hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents: 1019
diff changeset
185 @inlineCallbacks
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
186 def get(self):
1033
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
187 # return dmx list for that effect
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
188 uri = URIRef(self.get_argument('uri'))
1027
a38414bd3929 hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents: 1019
diff changeset
189 response = yield cyclone.httpclient.fetch(
a38414bd3929 hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents: 1019
diff changeset
190 networking.musicPlayer.path('time'))
a38414bd3929 hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents: 1019
diff changeset
191 songTime = json.loads(response.body)['t']
1033
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
192
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
193 node = EffectNode(self.settings.graph, uri)
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
194 outSub = node.eval(songTime)
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
195 self.write(json.dumps(outSub.get_dmx_list()))
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
196
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
197
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
198 # Completely not sure where the effect background loop should
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
199 # go. Another process could own it, and get this request repeatedly:
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
200 class SongEffectsEval(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
201
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
202 def get(self):
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
203 song = URIRef(self.get_argument('song'))
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
204 effects = effectsForSong(self.settings.graph, song)
1033
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
205 raise NotImplementedError
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
206 self.write(maxDict(effectDmxDict(e) for e in effects))
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
207 # return dmx dict for all effects in the song, already combined
1033
b5ee7aa9341a effecteval now runs effects in the background, following the current song, and sends dmx output
Drew Perttula <drewp@bigasterisk.com>
parents: 1027
diff changeset
208
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
209
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
210 class App(object):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
211
1114
a38955ba6f40 rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents: 1111
diff changeset
212 def __init__(self, show, outputWhere):
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
213 self.show = show
1114
a38955ba6f40 rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents: 1111
diff changeset
214 self.outputWhere = outputWhere
a38955ba6f40 rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents: 1111
diff changeset
215 self.graph = SyncedGraph(networking.rdfdb.url, "effectEval")
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
216 self.graph.initiallySynced.addCallback(self.launch).addErrback(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
217 log.error)
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
218
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
219 self.stats = scales.collection(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
220 '/',
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
221 scales.PmfStat('sendLevels'),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
222 scales.PmfStat('getMusic'),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
223 scales.PmfStat('evals'),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
224 scales.PmfStat('sendOutput'),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
225 scales.IntStat('errors'),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
226 )
1053
9937e2e3d17b effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents: 1052
diff changeset
227
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
228 def launch(self, *args):
1535
04f2e93f04e3 effecteval log startup error
Drew Perttula <drewp@bigasterisk.com>
parents: 1237
diff changeset
229 log.info('launch')
1548
5d8009daea51 effecteval ok to run with no output (?)
Drew Perttula <drewp@bigasterisk.com>
parents: 1535
diff changeset
230 if self.outputWhere:
5d8009daea51 effecteval ok to run with no output (?)
Drew Perttula <drewp@bigasterisk.com>
parents: 1535
diff changeset
231 self.loop = makeEffectLoop(self.graph, self.stats, self.outputWhere)
5d8009daea51 effecteval ok to run with no output (?)
Drew Perttula <drewp@bigasterisk.com>
parents: 1535
diff changeset
232 self.loop.startLoop()
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
233
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
234 SFH = cyclone.web.StaticFileHandler
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
235 self.cycloneApp = cyclone.web.Application(handlers=[
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
236 (r'/()', SFH, {
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
237 'path': 'light9/effecteval',
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
238 'default_filename': 'index.html'
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
239 }),
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
240 (r'/effect', EffectEdit),
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
241 (r'/effect\.js', StaticCoffee, {
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
242 'src': 'light9/effecteval/effect.coffee'
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
243 }),
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
244 (r'/(effect-components\.html)', SFH, {
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
245 'path': 'light9/effecteval'
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
246 }),
1041
a4632a7b2e17 upgrade knockout and jquery, simplify the static/ dirs for all web services
Drew Perttula <drewp@bigasterisk.com>
parents: 1033
diff changeset
247 (r'/effectUpdates', EffectUpdates),
1101
3074f635ee23 effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents: 1100
diff changeset
248 (r'/code', Code),
1041
a4632a7b2e17 upgrade knockout and jquery, simplify the static/ dirs for all web services
Drew Perttula <drewp@bigasterisk.com>
parents: 1033
diff changeset
249 (r'/songEffectsUpdates', SongEffectsUpdates),
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
250 (r'/effect/eval', EffectEval),
1044
a2081b9adfe4 effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents: 1043
diff changeset
251 (r'/songEffects', SongEffects),
1019
5939fce98fad notes for next step
drewp@bigasterisk.com
parents: 1018
diff changeset
252 (r'/songEffects/eval', SongEffectsEval),
1053
9937e2e3d17b effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents: 1052
diff changeset
253 (r'/stats', StatsForCyclone),
1180
6c4981f61bf8 subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents: 1141
diff changeset
254 ],
6c4981f61bf8 subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents: 1141
diff changeset
255 debug=True,
6c4981f61bf8 subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents: 1141
diff changeset
256 graph=self.graph,
6c4981f61bf8 subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents: 1141
diff changeset
257 stats=self.stats)
1043
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
258 reactor.listenTCP(networking.effectEval.port, self.cycloneApp)
aa45e5379c5a effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents: 1041
diff changeset
259 log.info("listening on %s" % networking.effectEval.port)
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
260
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
261
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
262 class StaticCoffee(PrettyErrorHandler, cyclone.web.RequestHandler):
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
263
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
264 def initialize(self, src):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
265 super(StaticCoffee, self).initialize()
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
266 self.src = src
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
267
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
268 def get(self):
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
269 self.set_header('Content-Type', 'application/javascript')
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
270 self.write(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
271 subprocess.check_output(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
272 ['/usr/bin/coffee', '--compile', '--print', self.src]))
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
273
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
274
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
275 if __name__ == "__main__":
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
276 parser = optparse.OptionParser()
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
277 parser.add_option(
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
278 '--show',
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
279 help='show URI, like http://light9.bigasterisk.com/show/dance2008',
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
280 default=showconfig.showUri())
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
281 parser.add_option("-v",
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
282 "--verbose",
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
283 action="store_true",
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
284 help="logging.DEBUG")
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
285 parser.add_option("--twistedlog",
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
286 action="store_true",
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
287 help="twisted logging")
1115
818275850003 effecteval screens for only the kinds of outputs that it can send, so i can run a second instance just for LEDs
Drew Perttula <drewp@bigasterisk.com>
parents: 1114
diff changeset
288 parser.add_option("--output", metavar="WHERE", help="dmx or leds")
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
289 (options, args) = parser.parse_args()
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
290 log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
291
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
292 if not options.show:
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
293 raise ValueError("missing --show http://...")
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1692
diff changeset
294
1115
818275850003 effecteval screens for only the kinds of outputs that it can send, so i can run a second instance just for LEDs
Drew Perttula <drewp@bigasterisk.com>
parents: 1114
diff changeset
295 app = App(URIRef(options.show), options.output)
1018
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
296 if options.twistedlog:
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
297 from twisted.python import log as twlog
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
298 twlog.startLogging(sys.stderr)
e28a443bd153 initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff changeset
299 reactor.run()