def __init__(self, url, filename, opts, curl_cache, parent): self.curl_cache = curl_cache self.parent = parent (url, parts) = opts.urlparser.parse(url, opts) (scheme, host, path, parm, query, frag) = parts opts.find_proxy(url, scheme) PyCurlFileObject.__init__(self, str(url), filename, opts)
def _do_perform(self): # WORKAROUND - BZ #1439758 - ensure first item in queue is performed alone to properly setup NSS if not self.parent.first_in_queue_done: self.parent.first_in_queue_lock.acquire() # If some other thread was faster, no need to block anymore if self.parent.first_in_queue_done: self.parent.first_in_queue_lock.release() try: PyCurlFileObject._do_perform(self) finally: if not self.parent.first_in_queue_done: self.parent.first_in_queue_done = True self.parent.first_in_queue_lock.release()
def _do_perform(self): # WORKAROUND - BZ #1439758 - ensure first item in queue is performed alone to properly setup NSS if not self.parent.first_in_queue_done: self.parent.first_in_queue_lock.acquire() # If some other thread was faster, no need to block anymore if self.parent.first_in_queue_done: self.parent.first_in_queue_lock.release() try: PyCurlFileObject._do_perform(self) finally: if not self.parent.first_in_queue_done: self.parent.first_in_queue_done = True self.parent.first_in_queue_lock.release()
def _set_opts(self, opts=None): if not opts: opts = {} PyCurlFileObject._set_opts(self, opts=opts) self.curl_obj.setopt(pycurl.FORBID_REUSE, 0) # pylint: disable=E1101
def __init__(self, url, filename, opts, curl_cache): self.curl_cache = curl_cache PyCurlFileObject.__init__(self, url, filename, opts)
def __init__(self, url, filename, opts, curl_cache): self.curl_cache = curl_cache PyCurlFileObject.__init__(self, url, filename, opts)
def _set_opts(self, opts=None): if not opts: opts = {} PyCurlFileObject._set_opts(self, opts=opts) self.curl_obj.setopt(pycurl.FORBID_REUSE, 0) # pylint: disable=E1101
def __init__(self, url, filename, opts, curl_cache, parent): self.curl_cache = curl_cache self.parent = parent PyCurlFileObject.__init__(self, url, filename, opts)
def __init__(self, url, filename, opts, curl_cache, parent): self.curl_cache = curl_cache self.parent = parent PyCurlFileObject.__init__(self, str(url), filename, opts)