summaryrefslogtreecommitdiffstats
path: root/module/ConfigParser.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-14 20:59:01 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-14 20:59:01 +0200
commit853d29a0f12cdcb6c406b829a57439c7ea9b570d (patch)
tree047d94a11037617521c7a50130a6ead538c5daf7 /module/ConfigParser.py
parentfixed config on webif + show description (diff)
downloadpyload-853d29a0f12cdcb6c406b829a57439c7ea9b570d.tar.xz
has_key refractored, package name generator by Geek
Diffstat (limited to 'module/ConfigParser.py')
-rw-r--r--module/ConfigParser.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index aa8367fb4..2a3469b21 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -95,8 +95,8 @@ class ConfigParser:
try:
homeconf = self.parseConfig("pyload.conf")
- if homeconf["remote"].has_key("username"):
- if homeconf["remote"].has_key("password"):
+ if "username" in homeconf["remote"]:
+ if "password" in homeconf["remote"]:
self.oldRemoteData = {"username": homeconf["remote"]["username"]["value"],
"password": homeconf["remote"]["username"]["value"]}
del homeconf["remote"]["password"]
@@ -197,11 +197,11 @@ class ConfigParser:
"""sets the config values from a parsed config file to values in destination"""
for section in config.iterkeys():
- if dest.has_key(section):
+ if section in dest:
for option in config[section].iterkeys():
if option in ("desc", "outline"): continue
- if dest[section].has_key(option):
+ if option in dest[section]:
dest[section][option]["value"] = config[section][option]["value"]
#else:
@@ -320,7 +320,7 @@ class ConfigParser:
#----------------------------------------------------------------------
def addPluginConfig(self, name, config, outline=""):
"""adds config options with tuples (name, type, desc, default)"""
- if not self.plugin.has_key(name):
+ if name not in self.plugin:
conf = {"desc": name,
"outline": outline}
self.plugin[name] = conf
@@ -329,7 +329,7 @@ class ConfigParser:
conf["outline"] = outline
for item in config:
- if conf.has_key(item[0]):
+ if item[0] in conf:
conf[item[0]]["type"] = item[1]
else:
conf[item[0]] = {
@@ -342,7 +342,7 @@ class ConfigParser:
""" remove old plugins from config """
for name in IGNORE:
- if self.plugin.has_key(name):
+ if name in self.plugin:
del self.plugin[name]
########################################################################