comparison py/uploader.py @ 254:ffe25107d520

put more things inside "try"
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2015 22:31:21 +0800
parents 86e638d564b0
children 6d06795aefbb
comparison
equal deleted inserted replaced
243:d9b819dcac53 254:ffe25107d520
56 if result != 'OK': 56 if result != 'OK':
57 raise Exception("Server returned %s" % result) 57 raise Exception("Server returned %s" % result)
58 58
59 @asyncio.coroutine 59 @asyncio.coroutine
60 def do(self): 60 def do(self):
61 readings = self.server.take_readings()
62 try: 61 try:
62 readings = self.server.take_readings()
63 tosend = self.get_tosend(readings) 63 tosend = self.get_tosend(readings)
64 nreadings = len(readings) 64 nreadings = len(readings)
65 yield from self.send(tosend) 65 yield from self.send(tosend)
66 readings = None 66 readings = None
67 D("Sent updated %d readings" % nreadings) 67 D("Sent updated %d readings" % nreadings)