diff options
author | mkaay <mkaay@mkaay.de> | 2011-02-05 15:28:44 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2011-02-05 15:28:44 +0100 |
commit | ab3697781e5e6f3c0babfaed3c190055e9287974 (patch) | |
tree | e68f5015fc863407062ec9e83fc60888b8ada78b | |
parent | user editor (diff) | |
download | pyload-ab3697781e5e6f3c0babfaed3c190055e9287974.tar.xz |
setup encoding fix
-rw-r--r-- | module/DatabaseBackend.py | 3 | ||||
-rw-r--r-- | module/setup.py | 17 | ||||
-rwxr-xr-x | pyLoadCore.py | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/module/DatabaseBackend.py b/module/DatabaseBackend.py index d8ad2d252..5aa3365fa 100644 --- a/module/DatabaseBackend.py +++ b/module/DatabaseBackend.py @@ -126,6 +126,7 @@ class DatabaseBackend(Thread): j = self.jobs.get() self.transactionLock.acquire() if j == "quit": + self.transactionLock.release() break j.processJob() if j.exception: @@ -137,7 +138,7 @@ class DatabaseBackend(Thread): @style.queue def shutdown(self): self.conn.commit() - self.jobs.put(("quit")) + self.jobs.put("quit") self.conn.close() def _checkVersion(self): 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) diff --git a/pyLoadCore.py b/pyLoadCore.py index 6334ca00d..875f0061e 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -139,7 +139,7 @@ class Core(object): def print_help(self): print "" - print "pyLoad %s Copyright (c) 2008-2011 the pyLoad Team" % CURRENT_VERSION + print "pyLoad v%s 2008-2011 the pyLoad Team" % CURRENT_VERSION print "" print "Usage: [python] pyLoadCore.py [options]" print "" |