Esempio n. 1
0
	def __init__(self, path, write_func, header_func):
		self._host = getopt("Servers")[HttpClient._nextserver]
		self._url =  "%s%s"%(self._host, path)
		self._path = path
		HttpClient._nextserver = 1 - HttpClient._nextserver
		client.Client.__init__(self, path, write_func)
		self._curl = None
		self._cache = cache.getcache()
		self._cache_file = None
		self._header_func = header_func
		self._chance = 0
Esempio n. 2
0
 def __init__(self, path, write_func, header_func):
     self._host = getopt("Servers")[HttpClient._nextserver]
     self._url = "%s%s" % (self._host, path)
     self._path = path
     HttpClient._nextserver = 1 - HttpClient._nextserver
     client.Client.__init__(self, path, write_func)
     self._curl = None
     self._cache = cache.getcache()
     self._cache_file = None
     self._header_func = header_func
     self._chance = 0
Esempio n. 3
0
def getclient(path, write_func, header_func):
    if cache.getcache().contains(path):
        return cacheclient.CacheClient(path, write_func, header_func)
    else:
        return httpclient.HttpClient(path, write_func, header_func)
Esempio n. 4
0
	def __init__(self, path, write_func, header_func):
		self._cache = cache.getcache()
		self._cache_mode, self._cache_file = self._cache.query(path)
		self._write_func = write_func
		self._header_func =  header_func
		self._path = path
Esempio n. 5
0
def getclient(path, write_func, header_func):
	if cache.getcache().contains(path):
		return cacheclient.CacheClient(path, write_func, header_func)
	else:
		return httpclient.HttpClient(path, write_func, header_func)
Esempio n. 6
0
 def __init__(self, path, write_func, header_func):
     self._cache = cache.getcache()
     self._cache_mode, self._cache_file = self._cache.query(path)
     self._write_func = write_func
     self._header_func = header_func
     self._path = path