Esempio n. 1
0
 def __init__(self, url = None):
     self.__clientID = "python_%s_%s_%s" % (PHPRPC_Client.__sid,
                                            random.randint(1 << 31, 1 << 32),
                                            math.floor(time.time()))
     PHPRPC_Client.__sid += 1
     if url != None:
         self.__urlstr = url
         self.__url = urlparse.urlsplit(url, 'http')
     else:
         self.__urlstr = ''
         self.__url = None
     self.__httpclients = []
     self.__key = None
     self.__keylength = 128
     self.__encryptmode = 0
     self.__keyexchanged = False
     self.__lock1 = threading.RLock()
     self.__lock2 = threading.RLock()
     self.__lock3 = threading.RLock()
     self.__proxy = None
     self.charset = 'utf-8'
     self.timeout = 30
     self.output = ''
     self.warning = None
     self.__server_version = None
Esempio n. 2
0
 def __init__(self, url=None):
     self.__clientID = "python_%s_%s_%s" % (
         PHPRPC_Client.__sid, random.randint(
             1 << 31, 1 << 32), math.floor(time.time()))
     PHPRPC_Client.__sid += 1
     if url != None:
         self.__urlstr = url
         self.__url = urlparse.urlsplit(url, 'http')
     else:
         self.__urlstr = ''
         self.__url = None
     self.__httpclients = []
     self.__key = None
     self.__keylength = 128
     self.__encryptmode = 0
     self.__keyexchanged = False
     self.__lock1 = threading.RLock()
     self.__lock2 = threading.RLock()
     self.__lock3 = threading.RLock()
     self.__proxy = None
     self.charset = 'utf-8'
     self.timeout = 30
     self.output = ''
     self.warning = None
     self.__server_version = None
Esempio n. 3
0
 def setProxy(self, host, port = None, username = None, password = None):
     self.__close()
     if host == None:
         self.__proxy = None
     else:
         self.__proxy = urlparse.urlsplit(host)
         if port != None:
             self.__proxy.port = port
         if username != None:
             self.__proxy.username = username
         if password != None:
             self.__proxy.password = password
Esempio n. 4
0
 def setProxy(self, host, port=None, username=None, password=None):
     self.__close()
     if host == None:
         self.__proxy = None
     else:
         self.__proxy = urlparse.urlsplit(host)
         if port != None:
             self.__proxy.port = port
         if username != None:
             self.__proxy.username = username
         if password != None:
             self.__proxy.password = password
Esempio n. 5
0
 def useService(self, url = None, username = None, password = None):
     if url != None:
         self.__close()
         self.__urlstr = url
         self.__url = urlparse.urlsplit(url, 'http')
         self.__key = None
         self.__keylength = 128
         self.__encryptmode = 0
         self.__keyexchanged = False
         self.charset = 'utf-8'
     if username != None:
         self.__url.username = username
     if password != None:
         self.__url.password = password
     return _Proxy(self.invoke)
Esempio n. 6
0
 def useService(self, url=None, username=None, password=None):
     if url != None:
         self.__close()
         self.__urlstr = url
         self.__url = urlparse.urlsplit(url, 'http')
         self.__key = None
         self.__keylength = 128
         self.__encryptmode = 0
         self.__keyexchanged = False
         self.charset = 'utf-8'
     if username != None:
         self.__url.username = username
     if password != None:
         self.__url.password = password
     return _Proxy(self.invoke)