Mercurial > code > home > repos > homeauto
diff service/starArduino/starArduino.py @ 841:ddc2cdbfde50
rdflib and jsonlib api updates
Ignore-this: feb4c3bee7704dee42f1d3a01b20f4e8
darcs-hash:20120808062410-312f9-2d5e41e2bb782e0e3946af63c6bbaf695f23fc16
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 07 Aug 2012 23:24:10 -0700 |
parents | a422d875d94d |
children | 4e34fd9aee00 |
line wrap: on
line diff
--- a/service/starArduino/starArduino.py Mon Aug 06 20:18:29 2012 -0700 +++ b/service/starArduino/starArduino.py Tue Aug 07 23:24:10 2012 -0700 @@ -4,7 +4,7 @@ """ from __future__ import division -import sys, jsonlib +import sys,json from twisted.internet import reactor, task from twisted.internet.task import LoopingCall import cyclone.web, restkit @@ -31,7 +31,7 @@ def get(self): f = self.settings.arduino.getTemperature() self.set_header("Content-Type", "application/json") - self.write(jsonlib.write({"temp" : f})) + self.write(json.dumps({"temp" : f})) class Brite(PrettyErrorHandler, cyclone.web.RequestHandler): def get(self, pos): @@ -86,7 +86,7 @@ 'K':'CODE128', }[code[0]] code = code[1:-1] - postBarcode.post(payload=jsonlib.dumps( + postBarcode.post(payload=json.dumps( {'barcodeType':codeType, 'code':code}), headers={"content-type" : "application/json"}) @@ -113,7 +113,7 @@ break else: raise ValueError("timed out waiting for chars") - return jsonlib.loads(line) + return json.loads(line) sb = A(numChannels=3)