diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-13 23:08:21 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-13 23:08:21 +0100 |
commit | cfa32735093dc01065be40312682c694d8c152d5 (patch) | |
tree | dc68608ca53c171b51cf59b4b367890848483c24 /module | |
parent | fix pornhub.com (diff) | |
download | pyload-cfa32735093dc01065be40312682c694d8c152d5.tar.xz |
new locale files
Diffstat (limited to 'module')
-rw-r--r-- | module/config/default.conf | 2 | ||||
-rw-r--r-- | module/database/FileDatabase.py | 39 | ||||
-rw-r--r-- | module/setup.py | 15 |
3 files changed, 12 insertions, 44 deletions
diff --git a/module/config/default.conf b/module/config/default.conf index b63a06b4c..335ca10fe 100644 --- a/module/config/default.conf +++ b/module/config/default.conf @@ -24,7 +24,7 @@ log - "Log": int log_size : "Size in kb" = 100
bool log_rotate : "Log Rotate" = True
general - "General":
- en;de;fr;it;es;nl;sv;ru;pl;cs;pt_BR language : "Language" = en
+ en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en
folder download_folder : "Download Folder" = Downloads
bool debug_mode : "Debug Mode" = False
bool checksum : "Use Checksum" = False
diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index d4514c710..f1c917b0a 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -194,7 +194,6 @@ class FileHandler: e = RemoveEvent("file", id, "collector" if not f.package().queue else "queue") oldorder = f.order - package = f.package if id in self.core.threadManager.processingIds(): self.cache[id].abortDownload() @@ -212,7 +211,7 @@ class FileHandler: pyfiles = self.cache.values() for pyfile in pyfiles: - if pyfile.packageid == package and pyfile.order > oldorder: + if pyfile.packageid == pid and pyfile.order > oldorder: pyfile.order -= 1 pyfile.notifyChange() @@ -576,11 +575,6 @@ class FileHandler: """ restart all failed links """ self.db.restartFailed() - @lock - @change - def fixPackageOrder(self, queue=0): - self.db.fixPackageOrder(queue) - class FileMethods(): @style.queue def filecount(self, queue): @@ -883,41 +877,10 @@ class FileMethods(): self.c.execute("DELETE FROM links WHERE status IN (0,4)") self.c.execute("DELETE FROM packages WHERE NOT EXISTS(SELECT 1 FROM links WHERE packages.id=links.package)") - @style.queue def restartFailed(self): self.c.execute("UPDATE links SET status=3,error='' WHERE status IN (8, 9)") - - @style.queue - def fixPackageOrder(self, queue=0): - found = 0 - order = 0 - i = 0 - self.c.execute("SELECT count(*) FROM packages WHERE queue = ?", (queue, )) - count = self.c.fetchone()[0] - if count == 0: - return - while order < count: - self.c.execute("SELECT id FROM packages WHERE packageorder = ? AND queue = ?", (i, queue)) - all = self.c.fetchall() - if len(all) == 0: - i += 1 - elif len(all) == 1: - self.c.execute("UPDATE packages SET packageorder=? WHERE id = ?", (order, all[0][0])) - order += 1 - i += 1 - elif len(all) > 1: - self.c.execute("UPDATE packages SET packageorder=? WHERE id = ?", (order, all[0][0])) - order += 1 - i += len(all) - del all[0] - self.c.execute("UPDATE packages SET packageorder=packageorder+? WHERE packageorder >= ? AND queue=?", (len(all), order, queue)) - for r in all: - self.c.execute("UPDATE packages SET packageorder=? WHERE id = ?", order, r[0]) - order += 1 - - @style.queue def findDuplicates(self, id, folder, filename): """ checks if filename exists with different id and same package """ diff --git a/module/setup.py b/module/setup.py index 85b33b1ee..91153fc82 100644 --- a/module/setup.py +++ b/module/setup.py @@ -454,9 +454,9 @@ class Setup(): info += ")" elif bool: if default == self.yes: - info = _("[y]/n") + info = "([%s]/%s)" % (self.yes, self.no) else: - info = _("y/[n]") + info = "(%s/[%s])" % (self.yes, self.no) else: info = "[%s]" % default @@ -488,7 +488,12 @@ class Setup(): print _("Passwords did not match.").decode("utf-8") while True: - input = raw_input(qst + " %s: " % info) + try: + input = raw_input(qst + " %s: " % info) + except KeyboardInterrupt: + print "\nSetup interrupted" + exit() + input = input.decode(sys.stdin.encoding) if input.strip() == "": @@ -496,10 +501,10 @@ class Setup(): if bool: # yes, true,t are inputs for booleans with value true - if input.lower().strip() in [self.yes, _("yes"), _("true"), _("t")]: + if input.lower().strip() in [self.yes, _("yes"), _("true"), _("t"), "yes"]: return True # no, false,f are inputs for booleans with value false - elif input.lower().strip() in [self.no, _("no"), _("false"), _("f")]: + elif input.lower().strip() in [self.no, _("no"), _("false"), _("f"), "no"]: return False else: print _("Invalid Input") |