From 80569fc6fdacd64ff61f75ab24991b488dd24143 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 27 Mar 2011 14:14:31 +0000 Subject: added error bar on the bottom side --- h-client/hlibrary.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'h-client/hlibrary.py') diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py index 415b04b..3205fbd 100644 --- a/h-client/hlibrary.py +++ b/h-client/hlibrary.py @@ -337,11 +337,16 @@ class Mycurl: c.setopt(c.POSTFIELDS, urllib.urlencode(self._post)) c.setopt(c.WRITEFUNCTION, self.body_callback) - c.perform() - - result = False - if c.getinfo(c.HTTP_CODE) == 200: + try: + c.perform() result = True + except: + result = False + + #print c.getinfo(c.HTTP_CODE) + #result = False + #if c.getinfo(c.HTTP_CODE) == 200: + #result = True c.close() return result @@ -573,7 +578,7 @@ class Client: dev[3] = idDevice else: self._status = False - self.errors.append("couldn't connect to host") + self.errors.append("unable to connect to server") def submit(self): for key,dev in self.devices.iteritems(): -- cgit v1.2.3