Changeset - a38955ba6f40
[Not reviewed]
default
0 14 0
Drew Perttula - 11 years ago 2014-06-13 05:25:02
drewp@bigasterisk.com
rdfdb port is now in the config
Ignore-this: 62a97aed9e0fe42604b8b59009b3d0e6
14 files changed with 23 insertions and 16 deletions:
0 comments (0 inline, 0 general)
bin/clientdemo
Show inline comments
 
@@ -5,6 +5,7 @@ sys.path.append(".")
 
from twisted.internet import reactor
 
import cyclone.web, cyclone.httpclient, logging
 
from rdflib import Namespace, Literal, URIRef
 
from light9 import networking
 
from light9.rdfdb.patch import Patch
 
from light9.rdfdb.syncedgraph import SyncedGraph
 

	
 
@@ -12,7 +13,7 @@ if __name__ == "__main__":
 
    logging.basicConfig(level=logging.DEBUG)
 
    log = logging.getLogger()
 

	
 
    g = SyncedGraph("clientdemo")
 
    g = SyncedGraph(networking.rdfdb.url, "clientdemo")
 

	
 
    from light9.Submaster import PersistentSubmaster
 
    sub = PersistentSubmaster(graph=g, uri=URIRef("http://light9.bigasterisk.com/sub/bcools"))
bin/curvecalc
Show inline comments
 
@@ -502,7 +502,7 @@ def main():
 
    session = clientsession.getUri('curvecalc', opts)
 

	
 
    music = Music()
 
    graph = SyncedGraph("curvecalc")
 
    graph = SyncedGraph(networking.rdfdb.url, "curvecalc")
 

	
 
    graph.initiallySynced.addCallback(
 
        lambda _: launch(args, graph, session, opts, startTime, music))
bin/effecteval
Show inline comments
 
@@ -181,9 +181,10 @@ class SongEffectsEval(PrettyErrorHandler
 
        # return dmx dict for all effects in the song, already combined
 

	
 
class App(object):
 
    def __init__(self, show):
 
    def __init__(self, show, outputWhere):
 
        self.show = show
 
        self.graph = SyncedGraph("effectEval")
 
        self.outputWhere = outputWhere
 
        self.graph = SyncedGraph(networking.rdfdb.url, "effectEval")
 
        self.graph.initiallySynced.addCallback(self.launch)
 

	
 
        self.stats = scales.collection('/',
bin/gtk_dnd_demo.py
Show inline comments
 
@@ -4,13 +4,14 @@ import gtk
 
import sys
 
sys.path.append(".")
 
from rdflib import URIRef
 
from light9 import networking
 
from light9.editchoicegtk import EditChoice, Local
 
from light9.observable import Observable
 
from light9.rdfdb.syncedgraph import SyncedGraph
 

	
 
win = gtk.Window()
 

	
 
graph = SyncedGraph("gtkdnddemo")
 
graph = SyncedGraph(networking.rdfdb.url, "gtkdnddemo")
 

	
 
r1 = URIRef("http://example.com/interestingThing")
 
v = Observable(r1)
bin/inputdemo
Show inline comments
 
@@ -26,7 +26,7 @@ class App(object):
 
        log.setLevel(logging.DEBUG if opts.debug else logging.INFO)
 

	
 
        self.session = clientsession.getUri('inputdemo', opts)
 
        self.graph = SyncedGraph("inputdemo")
 
        self.graph = SyncedGraph(networking.rdfdb.url, "inputdemo")
 

	
 
        self.graph.initiallySynced.addCallback(lambda _: self.launch())
 

	
bin/keyboardcomposer
Show inline comments
 
@@ -603,7 +603,7 @@ if __name__ == "__main__":
 

	
 
    log.setLevel(logging.INFO if opts.v else logging.WARN)
 

	
 
    graph = SyncedGraph("keyboardcomposer")
 
    graph = SyncedGraph(networking.rdfdb.url, "keyboardcomposer")
 

	
 
    # i think this also needs delayed start (like subcomposer has), to have a valid graph
 
    # before setting any stuff from the ui
bin/listsongs
Show inline comments
 
@@ -11,10 +11,11 @@ compdef _songs curvecalc
 
from run_local import log
 
from twisted.internet import reactor
 
from rdflib import RDF
 
from light9 import networking
 
from light9.namespaces import L9
 
from light9.rdfdb.syncedgraph import SyncedGraph
 

	
 
graph = SyncedGraph("listsongs")
 
graph = SyncedGraph(networking.rdfdb.url, "listsongs")
 

	
 
@graph.initiallySynced.addCallback
 
def printSongs(result):
bin/subcomposer
Show inline comments
 
@@ -273,7 +273,7 @@ if __name__ == "__main__":
 

	
 
    initTkdnd(root.tk, 'tkdnd/trunk/')
 

	
 
    graph = SyncedGraph("subcomposer")
 
    graph = SyncedGraph(networking.rdfdb.url, "subcomposer")
 
    session = clientsession.getUri('subcomposer', opts)
 

	
 
    graph.initiallySynced.addCallback(lambda _: launch(opts, args, root, graph, session))
bin/subserver
Show inline comments
 
@@ -115,7 +115,7 @@ if __name__ == "__main__":
 

	
 
    log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
 

	
 
    graph = SyncedGraph("subserver")
 
    graph = SyncedGraph(networking.rdfdb.url, "subserver")
 

	
 
    d = {}
 
    def updateSubs():
bin/vidref
Show inline comments
 
@@ -50,7 +50,7 @@ class Snapshot(cyclone.web.RequestHandle
 
class SnapshotPic(cyclone.web.StaticFileHandler):
 
    pass
 

	
 
graph = SyncedGraph("vidref")
 
graph = SyncedGraph(networking.rdfdb.url, "vidref")
 

	
 
gui = Gui(graph)
 

	
bin/vidrefsetup
Show inline comments
 
@@ -52,7 +52,7 @@ def main():
 
    (options, args) = parser.parse_args()
 

	
 
    log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
 
    graph = SyncedGraph("vidrefsetup")
 
    graph = SyncedGraph(networking.rdfdb.url, "vidrefsetup")
 

	
 
    # deliberately conflict with vidref since they can't talk at once to cam
 
    port = networking.vidref.port 
light9/networking.py
Show inline comments
 
@@ -42,3 +42,4 @@ curveCalc = ServiceAddress(L9['curveCalc
 
vidref = ServiceAddress(L9['vidref'])
 
effectEval = ServiceAddress(L9['effectEval'])
 
picamserve = ServiceAddress(L9['picamserve'])
 
rdfdb = ServiceAddress(L9['rdfdb'])
light9/rdfdb/syncedgraph.py
Show inline comments
 
@@ -51,17 +51,18 @@ class SyncedGraph(CurrentStateGraphApi, 
 
    pending local changes) and get the data again from the
 
    server.
 
    """
 
    def __init__(self, label):
 
    def __init__(self, rdfdbRoot, label):
 
        """
 
        label is a string that the server will display in association
 
        with your connection
 
        """
 
        self.rdfdbRoot = rdfdbRoot
 
        self.initiallySynced = defer.Deferred()
 
        self._graph = ConjunctiveGraph()
 

	
 
        self._receiver = PatchReceiver(label, self._onPatch)
 
        
 
        self._sender = PatchSender('http://localhost:8051/patches',
 
        self._sender = PatchSender(self.rdfdbRoot + 'patches',
 
                                   self._receiver.updateResource)
 
        AutoDepGraphApi.__init__(self)
 
        # this needs more state to track if we're doing a resync (and
 
@@ -84,7 +85,7 @@ class SyncedGraph(CurrentStateGraphApi, 
 
        self._sender.cancelAll()
 
        # this should be locked so only one resync goes on at once
 
        return cyclone.httpclient.fetch(
 
            url="http://localhost:8051/graph",
 
            url=self.rdfdbRoot + "graph",
 
            method="GET",
 
            headers={'Accept':['x-trig']},
 
            ).addCallback(self._resyncGraph)
show/dance2014/networking.n3
Show inline comments
 
@@ -3,7 +3,8 @@
 
@prefix sh: <http://light9.bigasterisk.com/show/dance2014/> .
 

	
 
show:dance2014 :networking sh:netHome .
 
sh:netHome  
 
sh:netHome
 
  :rdfdb            <http://localhost:8051/>;
 
  :effectEval       <http://dash:8070/>;
 
  :musicPlayer      <http://dash:8040/>;
 
  :dmxServer        <http://dash:8030/>;
0 comments (0 inline, 0 general)