summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-19 22:44:24 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-19 22:44:24 +0100
commit3b9885e40961bde996014c7e82d59daf2bd7ac14 (patch)
tree54f60f42b9b445d8b497d373a9d16eefd262ce87 /pyLoadCore.py
parentcatch real debrid error, when ip is blocked (diff)
downloadpyload-3b9885e40961bde996014c7e82d59daf2bd7ac14.tar.xz
disableble thriftbackend
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 56f32c9c5..47fb419e7 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -43,14 +43,13 @@ from module import InitHomeDir
from module.plugins.AccountManager import AccountManager
from module.CaptchaManager import CaptchaManager
from module.ConfigParser import ConfigParser
-from module.HookManager import HookManager
from module.plugins.PluginManager import PluginManager
from module.PullEvents import PullManager
from module.network.RequestFactory import RequestFactory
-from module.ThreadManager import ThreadManager
from module.web.ServerThread import WebServer
from module.Scheduler import Scheduler
from module.common.JsEngine import JsEngine
+from module import remote
from module.remote.RemoteManager import RemoteManager
from module.database import DatabaseBackend, FileHandler
@@ -77,6 +76,7 @@ class Core(object):
self.startedInGui = False
self.running = False
self.daemon = False
+ self.remote = True
self.arg_links = []
self.pidfile = "pyload.pid"
self.deleteLinks = False # will delete links on startup
@@ -85,7 +85,7 @@ class Core(object):
try:
options, args = getopt(argv[1:], 'vchdusq',
["version", "clear", "clean", "help", "debug", "user", "setup", "configdir=", "changedir", "daemon",
- "quit", "status"])
+ "quit", "status", "no-remote"])
for option, argument in options:
if option in ("-v", "--version"):
@@ -134,6 +134,8 @@ class Core(object):
elif option == "--clean":
self.cleanTree()
exit()
+ elif option == "--no-remote":
+ self.remote = False
except GetoptError:
print 'Unknown Argument(s) "%s"' % " ".join(argv[1:])
@@ -159,6 +161,7 @@ class Core(object):
print " --configdir=<dir>", " " * 6, "Run with <dir> as config directory"
print " --changedir", " " * 12, "Change config dir permanently"
print " --daemon", " " * 15, "Daemonmize after start"
+ print " --no-remote", " " * 14, "Disable remote access (saves RAM)"
print " --status", " " * 15, "Display pid if running or False"
print " --clean", " " * 16, "Remove .pyc/.pyo files"
print " -q, --quit", " " * 13, "Quit running pyLoad instance"
@@ -286,6 +289,7 @@ class Core(object):
translation.install(True)
self.debug = self.doDebug or self.config['general']['debug_mode']
+ self.remote &= self.config['remote']['activated']
pid = self.isAlreadyRunning()
if pid:
@@ -333,6 +337,9 @@ class Core(object):
#@TODO refractor
+ remote.activated = self.remote
+ self.log.debug("Remote activated: %s" % self.remote)
+
self.check_install("Crypto", _("pycrypto to decode container files"))
#img = self.check_install("Image", _("Python Image Libary (PIL) for captcha reading"))
#self.check_install("pycurl", _("pycurl to download any files"), True, True)
@@ -362,9 +369,15 @@ class Core(object):
self.lastClientConnected = 0
- from module.Api import Api
+ # later imported because they would trigger api import, and remote value not set correctly
+ from module.HookManager import HookManager
+ from module.ThreadManager import ThreadManager
+ from module import Api
+
+ if Api.activated != self.remote:
+ self.log.warning("Import error: API remote status not correct.")
- self.api = Api(self)
+ self.api = Api.Api(self)
self.scheduler = Scheduler(self)
@@ -387,8 +400,6 @@ class Core(object):
if web:
self.init_webserver()
- #linkFile = self.config['general']['link_file']
-
spaceLeft = freeSpace(self.config["general"]["download_folder"])
self.log.info(_("Free space: %s") % formatSize(spaceLeft))