summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-01-15 15:55:19 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-01-15 15:55:19 +0100
commit26227cfe53f8fd4bc1631d8e1b35031f589682dc (patch)
treed468ab14d8179c9a097c3d388ce29b8ab5747475 /pyLoadCore.py
parentplugin tester links (diff)
downloadpyload-26227cfe53f8fd4bc1631d8e1b35031f589682dc.tar.xz
backend + api test case, nicer format for plugin tester
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 233eda335..cfb2c38d0 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -62,7 +62,10 @@ from module.utils.fs import free_space, exists, makedirs, join
from codecs import getwriter
-enc = get_console_encoding(sys.stdout.encoding)
+# test runner overwrites sys.stdout
+if hasattr(sys.stdout, "encoding"): enc = get_console_encoding(sys.stdout.encoding)
+else: enc = "utf8"
+
sys._stdout = sys.stdout
sys.stdout = getwriter(enc)(sys.stdout, errors="replace")
@@ -265,7 +268,7 @@ class Core(object):
print join(path, f)
remove(join(path, f))
- def start(self, rpc=True, web=True):
+ def start(self, rpc=True, web=True, tests=False):
""" starts the fun :D """
self.version = CURRENT_VERSION
@@ -398,6 +401,9 @@ class Core(object):
self.js = JsEngine()
+ # enough initialization for test cases
+ if tests: return
+
self.log.info(_("Downloadtime: %s") % self.api.isTimeDownload())
if rpc: