comparison py/uploader.py @ 555:9dea75bd765f

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2015 22:33:04 +0800
parents 9499bd2f344b 39540ddacdca
children 26eee8591f61
comparison
equal deleted inserted replaced
553:d16afb5b5cd9 555:9dea75bd765f
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)