# HG changeset patch # User drewp@bigasterisk.com # Date 1381293546 25200 # Node ID 06ad4a0f42c09a7829a49beef5c1e09936ee8859 # Parent f5d8d61244345145486b37360927dc8684087a97 fix shuttlepro outgoing uri Ignore-this: c07186778bb07dab9e78c92f10f53a9b diff -r f5d8d6124434 -r 06ad4a0f42c0 service/shuttlepro/shuttlepro.py --- a/service/shuttlepro/shuttlepro.py Mon Oct 07 23:07:34 2013 -0700 +++ b/service/shuttlepro/shuttlepro.py Tue Oct 08 21:39:06 2013 -0700 @@ -358,12 +358,15 @@ reasoning = restkit.Resource("http://bang:9071/", timeout=1) from rdflib import Namespace, Graph, Literal -SHUTTLEPRO = Namespace("http://projects.bigasterisk.com/room/livingRoom/shuttlepro/") +SHUTTLEPRO = Namespace("http://bigasterisk.com/room/livingRoom/shuttlepro/") ROOM = Namespace("http://projects.bigasterisk.com/room/") if __name__ == '__main__': import restkit reasoning = restkit.Resource("http://bang:9071/", timeout=1) + + # this should serve a graph of the current state as well, not just all oneshots + def ev(what): print 'ev', what g = Graph() @@ -380,10 +383,11 @@ ROOM['clockwise'] if what['dial'] == 1 else ROOM['counterclockwise'])) try: + nt = g.serialize(format='nt') reasoning.post( "oneShot", - payload=g.serialize(format='nt'), - headers={'Content-Type': 'text/n3'} + payload=nt, + headers={'Content-Type': 'text/n3'}, ).body_string() except restkit.errors.RequestTimeout, e: log.error(e)