From 853d29a0f12cdcb6c406b829a57439c7ea9b570d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 14 Jul 2011 20:59:01 +0200 Subject: has_key refractored, package name generator by Geek --- module/network/CookieJar.py | 4 ++-- module/network/FTPBase.py | 4 ++-- module/network/RequestFactory.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'module/network') diff --git a/module/network/CookieJar.py b/module/network/CookieJar.py index c9ae6cb6c..c05812334 100644 --- a/module/network/CookieJar.py +++ b/module/network/CookieJar.py @@ -34,7 +34,7 @@ class CookieJar(): return self.cookies.values() def parseCookie(self, name): - if self.cookies.has_key(name): + if name in self.cookies: return self.cookies[name].split("\t")[6] else: return None @@ -47,4 +47,4 @@ class CookieJar(): self.cookies[name] = s def clear(self): - self.cookies = {} \ No newline at end of file + self.cookies = {} diff --git a/module/network/FTPBase.py b/module/network/FTPBase.py index ce4627d0c..d8fc5a20d 100644 --- a/module/network/FTPBase.py +++ b/module/network/FTPBase.py @@ -43,10 +43,10 @@ class FTPBase(FTP): proxytype = None proxy = None - if proxies.has_key("socks5"): + if "socks5" in proxies: proxytype = socks.PROXY_TYPE_SOCKS5 proxy = proxies["socks5"] - elif proxies.has_key("socks4"): + elif "socks4" in proxies: proxytype = socks.PROXY_TYPE_SOCKS4 proxy = proxies["socks4"] if proxytype: diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 1a38ace43..774249a70 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -69,7 +69,7 @@ class RequestFactory(): return rep def getCookieJar(self, pluginName, account=None): - if self.cookiejars.has_key((pluginName, account)): + if (pluginName, account) in self.cookiejars: return self.cookiejars[(pluginName, account)] cj = CookieJar(pluginName, account) @@ -121,4 +121,4 @@ def getURL(*args, **kwargs): def getRequest(*args, **kwargs): - return pyreq.getHTTPRequest() \ No newline at end of file + return pyreq.getHTTPRequest() -- cgit v1.2.3