comparison py/uploader.py @ 256:6d06795aefbb

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2015 22:33:04 +0800
parents 0a1b642e3086 ffe25107d520
children 26eee8591f61
comparison
equal deleted inserted replaced
255:8ef52f27cf95 256:6d06795aefbb
57 if r.status == 200 and result != 'OK': 57 if r.status == 200 and result != 'OK':
58 raise Exception("Server returned %s" % result) 58 raise Exception("Server returned %s" % result)
59 59
60 @asyncio.coroutine 60 @asyncio.coroutine
61 def do(self): 61 def do(self):
62 readings = self.server.take_readings()
63 try: 62 try:
63 readings = self.server.take_readings()
64 tosend = self.get_tosend(readings) 64 tosend = self.get_tosend(readings)
65 nreadings = len(readings) 65 nreadings = len(readings)
66 yield from self.send(tosend) 66 yield from self.send(tosend)
67 readings = None 67 readings = None
68 D("Sent updated %d readings" % nreadings) 68 D("Sent updated %d readings" % nreadings)