diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-17 18:29:39 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-17 18:29:39 +0200 |
commit | 8d928c2b27f2f8344e3debe26ea72542fbfab124 (patch) | |
tree | 7b98ef66db71bdf80414989f1ac9ac09c9698fe6 | |
parent | plugin unloading, closed #377, some fixes (diff) | |
download | pyload-8d928c2b27f2f8344e3debe26ea72542fbfab124.tar.xz |
not working restart method
-rw-r--r-- | module/Api.py | 5 | ||||
-rw-r--r-- | module/InitHomeDir.py | 1 | ||||
-rwxr-xr-x | pyLoadCore.py | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/module/Api.py b/module/Api.py index 1a69a0a27..54aeff669 100644 --- a/module/Api.py +++ b/module/Api.py @@ -183,8 +183,9 @@ class Api(Iface): self.core.do_kill = True def restart(self): - """Untested""" - self.core.do_restart = True + """Not working, not likely to ever will""" + pass + #self.core.do_restart = True def getLog(self, offset=0): """Returns most recent log entries. diff --git a/module/InitHomeDir.py b/module/InitHomeDir.py index 9a0fb60d8..156c9f932 100644 --- a/module/InitHomeDir.py +++ b/module/InitHomeDir.py @@ -25,6 +25,7 @@ import sys from sys import argv, platform import __builtin__ +__builtin__.owd = path.abspath("") #original working directory __builtin__.pypath = path.abspath(path.join(__file__, "..", "..")) sys.path.append(join(pypath, "module", "lib")) diff --git a/pyLoadCore.py b/pyLoadCore.py index d4475e247..13bfe2d12 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -30,7 +30,7 @@ from imp import find_module import logging import logging.handlers import os -from os import _exit, execv, getcwd, makedirs, remove, sep, walk +from os import _exit, execl, getcwd, makedirs, remove, sep, walk, chdir from os.path import exists, join import signal import subprocess @@ -535,7 +535,9 @@ class Core(object): def restart(self): self.shutdown() - execv(executable, [executable, "pyLoadCore.py"]) + chdir(owd) + execl(executable, executable, *sys.argv) + _exit(0) def shutdown(self): self.log.info(_("shutting down...")) |