Mercurial > code > home > repos > light9
changeset 1114:a38955ba6f40
rdfdb port is now in the config
Ignore-this: 62a97aed9e0fe42604b8b59009b3d0e6
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Fri, 13 Jun 2014 05:25:02 +0000 |
parents | 780e91cc21cc |
children | 818275850003 |
files | bin/clientdemo bin/curvecalc bin/effecteval bin/gtk_dnd_demo.py bin/inputdemo bin/keyboardcomposer bin/listsongs bin/subcomposer bin/subserver bin/vidref bin/vidrefsetup light9/networking.py light9/rdfdb/syncedgraph.py show/dance2014/networking.n3 |
diffstat | 14 files changed, 23 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/clientdemo Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/clientdemo Fri Jun 13 05:25:02 2014 +0000 @@ -5,6 +5,7 @@ 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 @@ 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"))
--- a/bin/curvecalc Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/curvecalc Fri Jun 13 05:25:02 2014 +0000 @@ -502,7 +502,7 @@ 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))
--- a/bin/effecteval Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/effecteval Fri Jun 13 05:25:02 2014 +0000 @@ -181,9 +181,10 @@ # 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('/',
--- a/bin/gtk_dnd_demo.py Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/gtk_dnd_demo.py Fri Jun 13 05:25:02 2014 +0000 @@ -4,13 +4,14 @@ 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)
--- a/bin/inputdemo Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/inputdemo Fri Jun 13 05:25:02 2014 +0000 @@ -26,7 +26,7 @@ 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())
--- a/bin/keyboardcomposer Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/keyboardcomposer Fri Jun 13 05:25:02 2014 +0000 @@ -603,7 +603,7 @@ 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
--- a/bin/listsongs Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/listsongs Fri Jun 13 05:25:02 2014 +0000 @@ -11,10 +11,11 @@ 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):
--- a/bin/subcomposer Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/subcomposer Fri Jun 13 05:25:02 2014 +0000 @@ -273,7 +273,7 @@ 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))
--- a/bin/subserver Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/subserver Fri Jun 13 05:25:02 2014 +0000 @@ -115,7 +115,7 @@ log.setLevel(logging.DEBUG if options.verbose else logging.INFO) - graph = SyncedGraph("subserver") + graph = SyncedGraph(networking.rdfdb.url, "subserver") d = {} def updateSubs():
--- a/bin/vidref Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/vidref Fri Jun 13 05:25:02 2014 +0000 @@ -50,7 +50,7 @@ class SnapshotPic(cyclone.web.StaticFileHandler): pass -graph = SyncedGraph("vidref") +graph = SyncedGraph(networking.rdfdb.url, "vidref") gui = Gui(graph)
--- a/bin/vidrefsetup Thu Jun 12 08:59:52 2014 +0000 +++ b/bin/vidrefsetup Fri Jun 13 05:25:02 2014 +0000 @@ -52,7 +52,7 @@ (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
--- a/light9/networking.py Thu Jun 12 08:59:52 2014 +0000 +++ b/light9/networking.py Fri Jun 13 05:25:02 2014 +0000 @@ -42,3 +42,4 @@ vidref = ServiceAddress(L9['vidref']) effectEval = ServiceAddress(L9['effectEval']) picamserve = ServiceAddress(L9['picamserve']) +rdfdb = ServiceAddress(L9['rdfdb'])
--- a/light9/rdfdb/syncedgraph.py Thu Jun 12 08:59:52 2014 +0000 +++ b/light9/rdfdb/syncedgraph.py Fri Jun 13 05:25:02 2014 +0000 @@ -51,17 +51,18 @@ 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 @@ 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)
--- a/show/dance2014/networking.n3 Thu Jun 12 08:59:52 2014 +0000 +++ b/show/dance2014/networking.n3 Fri Jun 13 05:25:02 2014 +0000 @@ -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/>;