Mercurial > code > home > repos > homeauto
diff service/reasoning/oneShot @ 1197:d8acab2b01f5
mqtt has two devices now. various older cleanups.
Ignore-this: 67ca3acc5dc6aa672d0c896c9f5ae48e
darcs-hash:964511475873219e6bc4725388a8d2e54a3c4e28
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 19 Jan 2019 12:08:59 -0800 |
parents | 114ca7fd9d01 |
children | 0996e3a91c85 |
line wrap: on
line diff
--- a/service/reasoning/oneShot Sat Jan 19 10:44:10 2019 -0800 +++ b/service/reasoning/oneShot Sat Jan 19 12:08:59 2019 -0800 @@ -3,7 +3,7 @@ send a statement to the reasoning server for one update cycle. Args are s/p/o in n3 notation, with many prefixes predefined here. """ -import sys, restkit, time +import sys, requests, time s, p, o = sys.argv[1:] prefixes = { @@ -25,9 +25,9 @@ print "Sending: %s" % stmt t1 = time.time() -reasoning = restkit.Resource("http://bang:9071/") -ret = reasoning.post("oneShot", - headers={"content-type": "text/n3"}, - payload=stmt) +ret = requests.post( + 'http://bang:9071/oneShot', + headers={"content-type": "text/n3"}, + data=stmt.encode('ascii')) g = float(ret.headers['x-graph-ms']) print "%.1f ms for graph update; %.1f ms other overhead" % (g, 1000 * (time.time() - t1) - g)