summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-11 22:46:26 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-11 22:46:26 +0200
commit25df148175278a087399b11748afefc71d4e809c (patch)
treee1de6d6af8177ff2c292dfe65e981643385ba85b
parentfolder name fix, skip existing files (diff)
downloadpyload-25df148175278a087399b11748afefc71d4e809c.tar.xz
account parser fix
-rw-r--r--module/AccountManager.py9
-rw-r--r--module/ConfigParser.py4
2 files changed, 7 insertions, 6 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py
index 6bfb63820..9c42d1ebe 100644
--- a/module/AccountManager.py
+++ b/module/AccountManager.py
@@ -76,8 +76,9 @@ class AccountManager():
content = f.readlines()
version = content.pop(0)
-
- if int(version.split(":")[1]) < ACC_VERSION:
+ version = version.split(":")[1].strip()
+
+ if not version or int(version) < ACC_VERSION:
copy("accounts.conf", "accounts.backup")
f.close()
f = open("accounts.conf", "wb")
@@ -89,7 +90,7 @@ class AccountManager():
plugin = ""
- account = ""
+ name = ""
for line in content:
line = line.strip()
@@ -107,7 +108,7 @@ class AccountManager():
self.accounts[plugin][name]["options"].append(tuple(option))
elif ":" in line:
- name, pw = line.split(":")[:]
+ name, sep,pw = line.partition(":")
self.accounts[plugin][name] = {"password": pw, "options": []}
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index d5f753b9b..568d22db9 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -63,7 +63,7 @@ class ConfigParser:
f.close()
v = v[v.find(":")+1:].strip()
- if int(v) < CONF_VERSION:
+ if not v or int(v) < CONF_VERSION:
copy(join(pypath,"module", "config", "default.conf"), "pyload.conf")
print "Old version of config was replaced"
@@ -72,7 +72,7 @@ class ConfigParser:
f.close()
v = v[v.find(":")+1:].strip()
- if int(v) < CONF_VERSION:
+ if not v or int(v) < CONF_VERSION:
f = open("plugin.conf", "wb")
f.write("version: "+str(CONF_VERSION))
f.close()