From e0c5b36dcc92d97c65f14290bb78b2327ff731a5 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 19 Mar 2011 15:27:48 +0000 Subject: added Client::setNode() --- h-client/hlibrary.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'h-client/hlibrary.py') diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py index e45cfbd..975f2f9 100644 --- a/h-client/hlibrary.py +++ b/h-client/hlibrary.py @@ -255,10 +255,14 @@ class Mycurl: #set the domain def __init__(self,domain): self.contents = '' + self.setDomain(domain) + + def setDomain(self,domain): self.domain = domain #check if the trailing slash is present - if self.domain[len(self.domain)-1] != '/': - self.domain += '/' + if len(self.domain) > 1: + if self.domain[len(self.domain)-1] != '/': + self.domain += '/' def setPost(self,post): self._post = post @@ -303,9 +307,12 @@ class Client: } } - def __init__(self,url): + def __init__(self,url = ''): self.request = Mycurl(url) - + + def setNode(self,domain): + self.request.setDomain(domain) + #get the type from the Class id def getType(self, Class): Classes = self._types.keys() -- cgit v1.2.3