summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-21 23:42:20 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-21 23:42:20 +0200
commit3a7da5aed9d57ecbc404d4ebebf20013d1a38cf4 (patch)
tree140fa3da9f9a0cdfdf334b4aa4a62f22d8fab7e8
parentconvert DB only if needed (diff)
downloadpyload-3a7da5aed9d57ecbc404d4ebebf20013d1a38cf4.tar.xz
some fixes
-rw-r--r--pyload/config/Setup.py11
-rw-r--r--pyload/database/User.py2
-rw-r--r--pyload/utils/printer.py4
3 files changed, 11 insertions, 6 deletions
diff --git a/pyload/config/Setup.py b/pyload/config/Setup.py
index f078d54d0..e2f96c802 100644
--- a/pyload/config/Setup.py
+++ b/pyload/config/Setup.py
@@ -24,6 +24,11 @@ class SetupAssistant(object):
self.lang = "en"
self.stdin_encoding = get_console_encoding(sys.stdin.encoding)
+ # Input shorthand for yes
+ self.yes = "y"
+ # Input shorthand for no
+ self.no = "n"
+
def start(self):
print
@@ -383,7 +388,7 @@ class SetupAssistant(object):
print _("2 - List users")
print _("3 - Remove user")
print _("4 - Quit")
- action = raw_input("[1]/2/3/4: ")
+ action = raw_input("1/2/3/4: ")
if not action in ("1", "2", "3", "4"):
continue
elif action == "1":
@@ -463,8 +468,8 @@ class SetupAssistant(object):
info = ""
print "%(dep)-12s %(bool)s (%(info)s)" % {'dep': name + ':',
- 'bool': _(true if value else false).upper(),
- 'info': info}
+ 'bool': _(true if value else false).upper(),
+ 'info': info}
def check_module(self, module):
diff --git a/pyload/database/User.py b/pyload/database/User.py
index 2aedc3bba..b5b44c50a 100644
--- a/pyload/database/User.py
+++ b/pyload/database/User.py
@@ -82,7 +82,7 @@ class UserMethods(object):
@style.queue
def getAllUserData(db):
db.c.execute("SELECT name, permission, role, template, email FROM users")
- return {{"permission": r[1], "role": r[2], "template": r[3], "email": r[4]} for r in db.c}
+ return {r[0]: {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]} for r in db.c}
@style.queue
diff --git a/pyload/utils/printer.py b/pyload/utils/printer.py
index 1122c7f4c..e4f6a360a 100644
--- a/pyload/utils/printer.py
+++ b/pyload/utils/printer.py
@@ -7,10 +7,10 @@ colorama.init(autoreset=True)
def color(color, text):
- return colorama.Fore.(c.upper())(text)
+ return colorama.Fore[c.upper()](text)
for c in colorama.Fore:
- eval("%(color) = lambda msg: color(%(color), msg)" % {'color': c.lower()}
+ eval("%(color)s = lambda msg: color(%(color)s, msg)" % {'color': c.lower()})
def overline(line, msg):