Files
@ 5c1b662c0263
Branch filter:
Location: light9/bin/clientdemo - annotation
5c1b662c0263
1.1 KiB
text/plain
stub updates
Ignore-this: 1c3a7199c6f2b6e85fd40c2d6bd2613c
Ignore-this: 1c3a7199c6f2b6e85fd40c2d6bd2613c
37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 5c158d37f1ce a38955ba6f40 6fa4288da8a6 6fa4288da8a6 37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 a38955ba6f40 37d05bd17b10 5c158d37f1ce 7772cc48e016 7772cc48e016 5c158d37f1ce 5c158d37f1ce 5c158d37f1ce 7772cc48e016 5c158d37f1ce 37d05bd17b10 37d05bd17b10 f066d6e874db 37d05bd17b10 37d05bd17b10 37d05bd17b10 37d05bd17b10 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 37d05bd17b10 37d05bd17b10 | #!bin/python
import os, sys
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 rdfdb.patch import Patch
from rdfdb.syncedgraph import SyncedGraph
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger()
g = SyncedGraph(networking.rdfdb.url, "clientdemo")
from light9.Submaster import PersistentSubmaster
sub = PersistentSubmaster(
graph=g, uri=URIRef("http://light9.bigasterisk.com/sub/bcools"))
#get sub to show its updating name, then push that all the way into KC gui so we can see just names refresh in there
L9 = Namespace("http://light9.bigasterisk.com/")
def updateDemoValue():
v = list(g.objects(L9['demo'], L9['is']))
print("demo value is %r" % v)
g.addHandler(updateDemoValue)
def adj():
g.patch(
Patch(addQuads=[(L9['demo'], L9['is'], Literal(os.getpid()),
L9['clientdemo'])],
delQuads=[]))
reactor.callLater(2, adj)
reactor.run()
|