def __init__(self): if NetworkAccessManager.__unique: raise NetworkAccessManager.__unique NetworkAccessManager.__unique = self QNetworkAccessManager.__init__(self) self.requestTokensInfo = None self.proxy_instance = QNetworkProxy(QNetworkProxy.NoProxy) # overloaded 'finished' signal so that we can store them in the history self.finished[QNetworkReply].connect(self.finished_overload) # setup network disk cache directoru (./user/cache) self.diskCache = QNetworkDiskCache() self.diskCache.setCacheDirectory(core.management.configuration['path']['cache']) self.setCache(self.diskCache) self.sheepURI = QUrl.fromLocalFile(core.management.configuration['path']['resources']).toString() # history model keeps all transaction in memory self.history = NetworkHistory(self.diskCache, self) self.post_history = POSTHistory() self.appinfo = SiteInfoStore(self) self.rewrite_stored_url = False self.urlrewriting = URLRewritingStore() # did we enable tampering data? if so, what is the tampering method self.tampering = False self.tampering_method = None self.intercept = False self.disable_referer = False # set the personnal cookie jar if not core.management.cookieJar: core.management.cookieJar = QNetworkCookieJar() self.setCookieJar(core.management.cookieJar) # store the SSL certificates self.sslCfg = QSslConfiguration.defaultConfiguration() sslCa = self.sslCfg.caCertificates() sslNew = QSslCertificate.fromPath(core.management.configuration['path']['certificates']) sslCa +=sslNew self.sslCfg.setCaCertificates(sslCa) QSslConfiguration.setDefaultConfiguration(self.sslCfg) QObject.connect(self, SIGNAL("authenticationRequired(QNetworkReply*, QAuthenticator*)"), self.authenticationRequired_Slot)