def __init__(self, parent=None): QNetworkAccessManager.__init__(self, parent) self.mathjax_prefix = str(uuid4()) self.mathjax_base = '%s://%s/%s/' % (FAKE_PROTOCOL, FAKE_HOST, self.mathjax_prefix) self.root = self.orig_root = os.path.dirname(P('viewer/blank.html', allow_user_override=False)) self.mime_map, self.single_pages, self.codec_map = {}, set(), {} self.mathjax_dir = P('mathjax', allow_user_override=False)
def __init__(self, *args): QNetworkAccessManager.__init__(self, *args) self.current_root = None self.cache = QNetworkDiskCache(self) self.setCache(self.cache) self.cache.setCacheDirectory(PersistentTemporaryDirectory(prefix='disk_cache_')) self.cache.setMaximumCacheSize(0)
def __init__(self, *args): QNetworkAccessManager.__init__(self, *args) self.current_root = None self.cache = QNetworkDiskCache(self) self.setCache(self.cache) self.cache.setCacheDirectory( PersistentTemporaryDirectory(prefix='disk_cache_')) self.cache.setMaximumCacheSize(0)
def __init__(self, log, disk_cache_size=50, parent=None): QNetworkAccessManager.__init__(self, parent) self.reply_count = 0 self.log = log if disk_cache_size > 0: self.cache = QNetworkDiskCache(self) self.cache.setCacheDirectory(PersistentTemporaryDirectory(prefix='disk_cache_')) self.cache.setMaximumCacheSize(int(disk_cache_size * 1024 * 1024)) self.setCache(self.cache) self.sslErrors.connect(self.on_ssl_errors) self.pf = ProxyFactory(log) self.setProxyFactory(self.pf) self.finished.connect(self.on_finished) self.cookie_jar = QNetworkCookieJar() self.setCookieJar(self.cookie_jar) self.main_thread = current_thread() self.report_reply_signal.connect(self.report_reply, type=Qt.QueuedConnection)