diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-14 17:27:59 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-14 17:27:59 +0100 |
commit | 72e06ea42a02d68627839017f124cfd883623e77 (patch) | |
tree | b5e2cad30c5fe484a1dee86d59fe2298934577d9 | |
parent | cp65001 is broken (diff) | |
download | pyload-72e06ea42a02d68627839017f124cfd883623e77.tar.xz |
pyLoad 0.4.9
-rw-r--r-- | module/Utils.py | 13 | ||||
-rw-r--r-- | module/database/FileDatabase.py | 4 | ||||
-rw-r--r-- | module/gui/connector.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 5 | ||||
-rw-r--r-- | module/setup.py | 6 | ||||
-rwxr-xr-x | pyLoadCore.py | 4 |
6 files changed, 15 insertions, 19 deletions
diff --git a/module/Utils.py b/module/Utils.py index 9c0856e2a..c965e33c4 100644 --- a/module/Utils.py +++ b/module/Utils.py @@ -49,7 +49,7 @@ def save_join(*args): # File System Encoding functions: # Use fs_encode before accesing files on disk, it will encode the string properly -if sys.getfilesystemencoding() == 'ANSI_X3.4-1968': +if sys.getfilesystemencoding().startswith('ANSI'): def fs_encode(string): try: string = string.encode('utf-8') @@ -61,14 +61,13 @@ if sys.getfilesystemencoding() == 'ANSI_X3.4-1968': else: fs_encode = fs_decode = lambda x: x # do nothing -def getConsoleEncoding(enc): +def get_console_encoding(enc): if os.name == "nt": if enc == "cp65001": # aka UTF-8 - print "ERROR: Windows codepage 65001 is not supported." - exit() - elif enc == "ascii": - print "WARNING: Your console's encoding was identified as ASCII. Forcing UTF-8 instead." - enc = "UTF-8" + print "WARNING: Windows codepage 65001 is not supported." + enc = "cp850" + else: + enc = "utf8" return enc diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index 90e6ee758..a4f94e9a3 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -850,7 +850,7 @@ class FileMethods(): cmd += ")" - cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE ((p.queue=1 AND l.plugin NOT IN %s) OR l.plugin IN %s) AND l.status IN (2,3,6,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % (cmd, pre) + cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE ((p.queue=1 AND l.plugin NOT IN %s) OR l.plugin IN %s) AND l.status IN (2,3,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % (cmd, pre) self.c.execute(cmd) # very bad! @@ -859,7 +859,7 @@ class FileMethods(): @style.queue def getPluginJob(self, plugins): """returns pyfile ids with suited plugins""" - cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE l.plugin IN %s AND l.status IN (2,3,6,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % plugins + cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE l.plugin IN %s AND l.status IN (2,3,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % plugins self.c.execute(cmd) # very bad! diff --git a/module/gui/connector.py b/module/gui/connector.py index 129d26a50..c16ccd08e 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -16,7 +16,7 @@ @author: mkaay """ -SERVER_VERSION = "0.4.8" +SERVER_VERSION = "0.4.9" from time import sleep from uuid import uuid4 as uuid diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 11866bb16..aae76e781 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -70,7 +70,7 @@ def create_getInfo(plugin): class PluginParseError(Exception): def __init__(self, msg): - Exception.__init__ + Exception.__init__(self) self.value = 'Parse error (%s) - plugin may be out of date' % msg def __str__(self): return repr(self.value) @@ -111,8 +111,7 @@ class SimpleHoster(Hoster): def getFileInfo(self): self.logDebug("URL: %s" % self.pyfile.url) if hasattr(self, "TEMP_OFFLINE_PATTERN") and search(self.TEMP_OFFLINE_PATTERN, self.html): - self.logInfo("Link %s is temporarily offline" % self.pyfile.url) - self.retry(5, 3600, "Temporarily offline") + self.tempOffline() file_info = parseFileInfo(self, infomode = True) if file_info['status'] == 1: diff --git a/module/setup.py b/module/setup.py index 0e8b54848..f90afe23a 100644 --- a/module/setup.py +++ b/module/setup.py @@ -28,7 +28,7 @@ from subprocess import PIPE from subprocess import call import sys from sys import exit -from module.utils import getConsoleEncoding +from module.utils import get_console_encoding class Setup(): """ @@ -38,7 +38,7 @@ class Setup(): def __init__(self, path, config): self.path = path self.config = config - self.stdin_encoding = getConsoleEncoding(sys.stdin.encoding) + self.stdin_encoding = get_console_encoding(sys.stdin.encoding) def start(self): langs = self.config.getMetaData("general", "language")["type"].split(";") @@ -190,8 +190,6 @@ class Setup(): """ make a systemcheck and return the results""" print _("## System Check ##") - python = False - if sys.version_info[:2] > (2, 7): print _("Your python version is to new, Please use Python 2.6/2.7") python = False diff --git a/pyLoadCore.py b/pyLoadCore.py index e43c4bcf8..e6b539097 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -53,11 +53,11 @@ from module import remote from module.remote.RemoteManager import RemoteManager from module.database import DatabaseBackend, FileHandler -from module.utils import freeSpace, formatSize, getConsoleEncoding +from module.utils import freeSpace, formatSize, get_console_encoding from codecs import getwriter -enc = getConsoleEncoding(sys.stdout.encoding) +enc = get_console_encoding(sys.stdout.encoding) sys.stdout = getwriter(enc)(sys.stdout, errors="replace") # TODO List |