Mercurial > code > home > repos > light9
annotate bin/effecteval @ 1570:0480fc790527
paint now looks for best match
Ignore-this: 5604a2a2181624a0612dddf1afa32985
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 27 May 2017 12:22:28 +0000 |
parents | 13e3cbe9071a |
children | 30c79f1dc4f8 |
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 |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
2 from __future__ import division |
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 |
1116
2a89050c140b
another sys.path for raspi dirs
Drew Perttula <drewp@bigasterisk.com>
parents:
1115
diff
changeset
|
10 sys.path.append('/usr/lib/pymodules/python2.7/') # for numpy, on rpi |
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
|
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 |
1044
a2081b9adfe4
effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents:
1043
diff
changeset
|
18 from light9.rdfdb.patch import Patch |
1079
fce46850ed8c
consolidate the curve load/save rdf code more
Drew Perttula <drewp@bigasterisk.com>
parents:
1076
diff
changeset
|
19 from light9.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 |
1054
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
24 class EffectEdit(PrettyErrorHandler, cyclone.web.RequestHandler): |
1018
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
25 def get(self): |
1217
e703b3434dbd
websocket and web cleanup
Drew Perttula <drewp@bigasterisk.com>
parents:
1212
diff
changeset
|
26 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
|
27 self.write(open("light9/effecteval/effect.html").read()) |
1054
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
28 def delete(self): |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
29 graph = self.settings.graph |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
30 uri = URIRef(self.get_argument('uri')) |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
31 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
|
32 song = ctx = list(g.subjects(L9['effect'], uri))[0] |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
33 self.settings.graph.patch(Patch(delQuads=[ |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
34 (song, L9['effect'], uri, ctx), |
4595a82f5a90
effecteval has a delete button on effect rows
Drew Perttula <drewp@bigasterisk.com>
parents:
1053
diff
changeset
|
35 ])) |
1055
6ce00faec207
move sequentialUri to the graph lib
Drew Perttula <drewp@bigasterisk.com>
parents:
1054
diff
changeset
|
36 |
1181
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
37 @inlineCallbacks |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
38 def currentSong(): |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
39 s = (yield getMusicStatus())['song'] |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
40 if s is None: |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
41 raise ValueError("no current song") |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
42 returnValue(URIRef(s)) |
1187
102a456be7db
refactor EE moving towards the ability to re-bump existing curves
drewp@bigasterisk.com
parents:
1181
diff
changeset
|
43 |
1044
a2081b9adfe4
effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents:
1043
diff
changeset
|
44 class SongEffects(PrettyErrorHandler, cyclone.web.RequestHandler): |
1181
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
45 def wideOpenCors(self): |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
46 self.set_header('Access-Control-Allow-Origin', '*') |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
47 self.set_header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS') |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
48 self.set_header('Access-Control-Max-Age', '1000') |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
49 self.set_header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With') |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
50 |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
51 def options(self): |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
52 self.wideOpenCors() |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
53 self.write('') |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
54 |
1180
6c4981f61bf8
subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents:
1141
diff
changeset
|
55 @inlineCallbacks |
1044
a2081b9adfe4
effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents:
1043
diff
changeset
|
56 def post(self): |
1181
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
57 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
|
58 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
|
59 |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
60 try: |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
61 song = URIRef(self.get_argument('uri')) |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
62 except Exception: # which? |
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
63 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
|
64 |
1558
7eb3676b8fd6
more of the fixed add-to-song service
Drew Perttula <drewp@bigasterisk.com>
parents:
1557
diff
changeset
|
65 event = self.get_argument('event', default='default') |
1566
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
66 |
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
67 note = self.get_argument('note', default=None) |
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
68 if note is not None: |
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
69 note = URIRef(note) |
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
70 |
1181
c677bf37a1b4
effect list has button to add to current song
Drew Perttula <drewp@bigasterisk.com>
parents:
1180
diff
changeset
|
71 log.info("adding to %s", song) |
1566
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
72 note, p = yield songNotePatch(self.settings.graph, dropped, song, event, ctx=song, note=note) |
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
73 |
1557
104ff4606565
cleanup. internal names in edit.py
Drew Perttula <drewp@bigasterisk.com>
parents:
1556
diff
changeset
|
74 self.settings.graph.patch(p) |
1559
1ba1d46a70a2
put song: prefix into song files
Drew Perttula <drewp@bigasterisk.com>
parents:
1558
diff
changeset
|
75 self.settings.graph.suggestPrefixes({'song': URIRef(song + '/')}) |
1566
13e3cbe9071a
momentary-add button support
Drew Perttula <drewp@bigasterisk.com>
parents:
1560
diff
changeset
|
76 self.write(json.dumps({'note': note})) |
1044
a2081b9adfe4
effecteval now takes dropped subs and makes new effects out of them
Drew Perttula <drewp@bigasterisk.com>
parents:
1043
diff
changeset
|
77 |
1043
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
78 class SongEffectsUpdates(cyclone.websocket.WebSocketHandler): |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
79 def connectionMade(self, *args, **kwargs): |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
80 self.graph = self.settings.graph |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
81 self.graph.addHandler(self.updateClient) |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
82 |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
83 def updateClient(self): |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
84 # todo: abort if client is gone |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
85 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
|
86 songs = list(self.graph.items(playlist)) |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
87 out = [] |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
88 for s in songs: |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
89 out.append({'uri': s, 'label': self.graph.label(s)}) |
1140
3f7de54de79e
on songeffects page, show effect labels
drewp@bigasterisk.com
parents:
1139
diff
changeset
|
90 out[-1]['effects'] = [{'uri': uri, 'label': self.graph.label(uri)} 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
|
91 self.sendMessage({'songs': out}) |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
92 |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
93 |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
94 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
|
95 """ |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
96 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
|
97 """ |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
98 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
|
99 log.info("websocket opened") |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
100 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
|
101 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
|
102 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
103 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
|
104 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
|
105 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
106 def updateClient(self): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
107 # 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
|
108 # graph updates |
1108
4b542d321c8f
effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents:
1107
diff
changeset
|
109 |
4b542d321c8f
effectnode runs multiple lines of code in dependency order
Drew Perttula <drewp@bigasterisk.com>
parents:
1107
diff
changeset
|
110 # 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
|
111 # 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
|
112 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
|
113 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
|
114 self.sendMessage({'codeLines': codeLines}) |
1018
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
115 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
116 def connectionLost(self, reason): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
117 log.info("websocket closed") |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
118 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
119 def messageReceived(self, message): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
120 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
|
121 # 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
|
122 |
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
|
123 def replaceObjects(graph, c, s, p, newObjs): |
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
|
124 patch = graph.getObjectPatch( |
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
|
125 context=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
|
126 subject=s, |
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
|
127 predicate=p, |
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
|
128 newObject=newObjs[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
|
129 |
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
|
130 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 |
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
|
137 |
1101
3074f635ee23
effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents:
1100
diff
changeset
|
138 class Code(PrettyErrorHandler, cyclone.web.RequestHandler): |
3074f635ee23
effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents:
1100
diff
changeset
|
139 def put(self): |
3074f635ee23
effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents:
1100
diff
changeset
|
140 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 if not codeLines: |
1111 | 150 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
|
151 return |
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
|
152 with self.settings.graph.currentState( |
771f50f19b4b
single-line effect code now evals by changing <uri> into a suitable python object
Drew Perttula <drewp@bigasterisk.com>
parents:
1101
diff
changeset
|
153 tripleFilter=(None, L9['effect'], effect)) as g: |
1101
3074f635ee23
effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents:
1100
diff
changeset
|
154 song = g.subjects(L9['effect'], effect).next() |
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
|
155 |
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 replaceObjects(self.settings.graph, song, effect, L9['code'], 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
|
157 |
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
|
158 # 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
|
159 self.send_error(202) |
1019 | 160 |
161 class EffectEval(PrettyErrorHandler, cyclone.web.RequestHandler): | |
1027
a38414bd3929
hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents:
1019
diff
changeset
|
162 @inlineCallbacks |
1019 | 163 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
|
164 # return dmx list for that effect |
1019 | 165 uri = URIRef(self.get_argument('uri')) |
1027
a38414bd3929
hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents:
1019
diff
changeset
|
166 response = yield cyclone.httpclient.fetch( |
a38414bd3929
hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents:
1019
diff
changeset
|
167 networking.musicPlayer.path('time')) |
a38414bd3929
hacking on effecteval
Drew Perttula <drewp@bigasterisk.com>
parents:
1019
diff
changeset
|
168 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
|
169 |
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
|
170 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
|
171 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
|
172 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
|
173 |
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
|
174 |
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
|
175 # 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
|
176 # go. Another process could own it, and get this request repeatedly: |
1019 | 177 class SongEffectsEval(PrettyErrorHandler, cyclone.web.RequestHandler): |
178 def get(self): | |
179 song = URIRef(self.get_argument('song')) | |
180 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
|
181 raise NotImplementedError |
1019 | 182 self.write(maxDict(effectDmxDict(e) for e in effects)) |
183 # 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
|
184 |
1018
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
185 class App(object): |
1114
a38955ba6f40
rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
1111
diff
changeset
|
186 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
|
187 self.show = show |
1114
a38955ba6f40
rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
1111
diff
changeset
|
188 self.outputWhere = outputWhere |
a38955ba6f40
rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
1111
diff
changeset
|
189 self.graph = SyncedGraph(networking.rdfdb.url, "effectEval") |
1535
04f2e93f04e3
effecteval log startup error
Drew Perttula <drewp@bigasterisk.com>
parents:
1237
diff
changeset
|
190 self.graph.initiallySynced.addCallback(self.launch).addErrback(log.error) |
1043
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
191 |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
192 self.stats = scales.collection('/', |
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
193 scales.PmfStat('sendLevels'), |
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
194 scales.PmfStat('getMusic'), |
1122
17b24cb10202
gather more output loop timing
Drew Perttula <drewp@bigasterisk.com>
parents:
1116
diff
changeset
|
195 scales.PmfStat('evals'), |
1123 | 196 scales.PmfStat('sendOutput'), |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
197 scales.IntStat('errors'), |
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
198 ) |
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
199 |
1043
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
200 def launch(self, *args): |
1535
04f2e93f04e3
effecteval log startup error
Drew Perttula <drewp@bigasterisk.com>
parents:
1237
diff
changeset
|
201 log.info('launch') |
1548
5d8009daea51
effecteval ok to run with no output (?)
Drew Perttula <drewp@bigasterisk.com>
parents:
1535
diff
changeset
|
202 if self.outputWhere: |
5d8009daea51
effecteval ok to run with no output (?)
Drew Perttula <drewp@bigasterisk.com>
parents:
1535
diff
changeset
|
203 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
|
204 self.loop.startLoop() |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
205 |
1018
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
206 SFH = cyclone.web.StaticFileHandler |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
207 self.cycloneApp = cyclone.web.Application(handlers=[ |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
208 (r'/()', SFH, |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
209 {'path': 'light9/effecteval', 'default_filename': 'index.html'}), |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
210 (r'/effect', EffectEdit), |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
211 (r'/effect\.js', StaticCoffee, {'src': 'light9/effecteval/effect.coffee'}), |
1237
ad90eb1f5493
port effecteval root page from knockout to polymer
Drew Perttula <drewp@bigasterisk.com>
parents:
1217
diff
changeset
|
212 (r'/(effect-components\.html)', SFH, {'path': 'light9/effecteval'}), |
1041
a4632a7b2e17
upgrade knockout and jquery, simplify the static/ dirs for all web services
Drew Perttula <drewp@bigasterisk.com>
parents:
1033
diff
changeset
|
213 (r'/effectUpdates', EffectUpdates), |
1101
3074f635ee23
effect page can write code edits back
Drew Perttula <drewp@bigasterisk.com>
parents:
1100
diff
changeset
|
214 (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
|
215 (r'/songEffectsUpdates', SongEffectsUpdates), |
1019 | 216 (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
|
217 (r'/songEffects', SongEffects), |
1019 | 218 (r'/songEffects/eval', SongEffectsEval), |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
219 (r'/stats', StatsForCyclone), |
1180
6c4981f61bf8
subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents:
1141
diff
changeset
|
220 ], |
6c4981f61bf8
subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents:
1141
diff
changeset
|
221 debug=True, |
6c4981f61bf8
subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents:
1141
diff
changeset
|
222 graph=self.graph, |
6c4981f61bf8
subserver inserts effects with envelope curves
Drew Perttula <drewp@bigasterisk.com>
parents:
1141
diff
changeset
|
223 stats=self.stats) |
1043
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
224 reactor.listenTCP(networking.effectEval.port, self.cycloneApp) |
aa45e5379c5a
effecteval improvements. displays current song+effect tree
Drew Perttula <drewp@bigasterisk.com>
parents:
1041
diff
changeset
|
225 log.info("listening on %s" % networking.effectEval.port) |
1053
9937e2e3d17b
effecteval faster loop, stats page
Drew Perttula <drewp@bigasterisk.com>
parents:
1052
diff
changeset
|
226 |
1018
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
227 class StaticCoffee(PrettyErrorHandler, cyclone.web.RequestHandler): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
228 def initialize(self, src): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
229 super(StaticCoffee, self).initialize() |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
230 self.src = src |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
231 def get(self): |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
232 self.set_header('Content-Type', 'application/javascript') |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
233 self.write(subprocess.check_output([ |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
234 '/usr/bin/coffee', '--compile', '--print', self.src])) |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
235 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
236 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
237 if __name__ == "__main__": |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
238 parser = optparse.OptionParser() |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
239 parser.add_option('--show', |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
240 help='show URI, like http://light9.bigasterisk.com/show/dance2008', |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
241 default=showconfig.showUri()) |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
242 parser.add_option("-v", "--verbose", action="store_true", |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
243 help="logging.DEBUG") |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
244 parser.add_option("--twistedlog", action="store_true", |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
245 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
|
246 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
|
247 (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
|
248 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
|
249 |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
250 if not options.show: |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
251 raise ValueError("missing --show http://...") |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
252 |
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
|
253 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
|
254 if options.twistedlog: |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
255 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
|
256 twlog.startLogging(sys.stderr) |
e28a443bd153
initial effecteval that can propagate changes from the graph to a web page
drewp@bigasterisk.com
parents:
diff
changeset
|
257 reactor.run() |