aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-03-27 14:14:31 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-03-27 14:14:31 +0000
commit80569fc6fdacd64ff61f75ab24991b488dd24143 (patch)
tree4a97ef8d73b9720047a02fa457e330cbd894907c /h-client/hlibrary.py
parentefd2c8034502bc1b17da3ce6cb42172829e3f04a (diff)
added error bar on the bottom side
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py15
1 files changed, 10 insertions, 5 deletions
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():