Changeset - 5939fce98fad
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 11 years ago 2014-05-26 07:45:06
drewp@bigasterisk.com
notes for next step
Ignore-this: 302635a526c833e818eaff3e566d07e7
2 files changed with 19 insertions and 0 deletions:
0 comments (0 inline, 0 general)
bin/effecteval
Show inline comments
 
@@ -38,12 +38,28 @@ class EffectData(cyclone.websocket.WebSo
 
    def connectionLost(self, reason):
 
        log.info("websocket closed")
 

	
 
    def messageReceived(self, message):
 
        log.info("got message %s" % message)
 
        # write a patch back to the graph
 

	
 
def effectDmxDict(graph, effect):
 
    
 
        
 
class EffectEval(PrettyErrorHandler, cyclone.web.RequestHandler):
 
    def get(self):
 
        uri = URIRef(self.get_argument('uri'))
 
        # return dmx dict for that effect
 
        self.write(effectDmxDict(self.settings.graph, uri))
 
        
 
class SongEffectsEval(PrettyErrorHandler, cyclone.web.RequestHandler):
 
    def get(self):
 
        song = URIRef(self.get_argument('song'))
 
        effects = effectsForSong(self.settings.graph, song)
 
        self.write(maxDict(effectDmxDict(e) for e in effects))
 
        # return dmx dict for all effects in the song, already combined
 
        
 
class App(object):
 
    def __init__(self, show):
 
        self.show = show
 
        self.graph = SyncedGraph("effectEval")
 
        SFH = cyclone.web.StaticFileHandler
 
@@ -53,12 +69,14 @@ class App(object):
 
            (r'/effect', EffectEdit),
 
            (r'/(websocket\.js)', SFH, {'path': 'light9/rdfdb/web/'}),
 
            (r'/(knockout-2\.2\.1\.js)', SFH, {'path': 'light9/subserver/'}),
 
            (r'/effect\.js', StaticCoffee, {'src': 'light9/effecteval/effect.coffee'}),
 
            (r'/effectData', EffectData),
 
            (r'/static/(.*)', SFH, {'path': 'static/'}),
 
            (r'/effect/eval', EffectEval),
 
            (r'/songEffects/eval', SongEffectsEval),
 
        ], debug=True, graph=self.graph)
 
        #graph.initiallySynced.addCallback(
 

	
 
        # see bin/subserver
 

	
 
class StaticCoffee(PrettyErrorHandler, cyclone.web.RequestHandler):
show/dance2014/demo.n3
Show inline comments
 
@prefix : <http://light9.bigasterisk.com/> .
 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
 

	
 
# curvedb writes these. point data might be in separate files
 
<http://ex/effect/song1/opening> a :Curve;
 
  rdfs:label "opening";
 
  :points "0.0 0 183.695203336 0" .
 
  
 

	
 
  
0 comments (0 inline, 0 general)