Files @ 904913de4599
Branch filter:

Location: light9/bin/clientdemo - annotation

drewp@bigasterisk.com
deletes are now quads. refactor files. named clients. auto client port
Ignore-this: 44f83643c28cbb0f961e2c8c1267d398
#!bin/python

import os, sys
sys.path.append(".")
from twisted.internet import reactor
import cyclone.web, cyclone.httpclient, logging
from rdflib import Namespace, Literal
from light9.rdfdb.patch import Patch
from light9.rdfdb.syncedgraph import SyncedGraph

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    log = logging.getLogger()

    g = SyncedGraph("clientdemo")

    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()