summaryrefslogtreecommitdiffstats
path: root/module/setup.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2011-02-05 15:28:44 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2011-02-05 15:28:44 +0100
commitab3697781e5e6f3c0babfaed3c190055e9287974 (patch)
treee68f5015fc863407062ec9e83fc60888b8ada78b /module/setup.py
parentuser editor (diff)
downloadpyload-ab3697781e5e6f3c0babfaed3c190055e9287974.tar.xz
setup encoding fix
Diffstat (limited to 'module/setup.py')
-rw-r--r--module/setup.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/module/setup.py b/module/setup.py
index d8776f607..df63dda68 100644
--- a/module/setup.py
+++ b/module/setup.py
@@ -299,25 +299,29 @@ class Setup():
db = DatabaseBackend(None)
db.setup()
+ noaction = True
try:
while True:
print _("Select action")
print _("1 - Create/Edit user")
print _("2 - List users")
print _("3 - Remove user")
- action = raw_input("[1]/2/3 ")
- if not action in ("1", "2", "3"):
+ print _("4 - Quit")
+ action = raw_input("[1]/2/3/4 ")
+ if not action in ("1", "2", "3", "4"):
continue
elif action == "1":
print ""
username = self.ask(_("Username"), "User")
password = self.ask("", "", password=True)
db.addUser(username, password)
+ noaction = False
elif action == "2":
print ""
print _("Users")
print "-----"
users = db.listUsers()
+ noaction = False
for user in users:
print user
print "-----"
@@ -327,10 +331,15 @@ class Setup():
username = self.ask(_("Username"), "")
if username:
db.removeUser(username)
+ noaction = False
+ elif action == "4":
+ break
except KeyboardInterrupt:
print "" #clean
pass
- db.shutdown()
+ finally:
+ if not noaction:
+ db.shutdown()
def conf_path(self, trans=False):
if trans:
@@ -419,7 +428,7 @@ class Setup():
if p1 == p2:
return p1
else:
- print _("Passwords did not match.")
+ print _("Passwords did not match.").decode("utf-8")
while True:
input = raw_input(qst + " %s: " % info)