summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/ConfigParser.py24
-rw-r--r--module/plugins/PluginManager.py2
-rwxr-xr-xpyLoadCore.py12
3 files changed, 21 insertions, 17 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index 064f74e36..78b612f13 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -8,8 +8,11 @@ from shutil import copy
from traceback import print_exc
from utils import chmod
-IGNORE = ("FreakshareNet", "SpeedManager", "ArchiveTo", "ShareCx", ('hooks', 'UnRar'))
# ignore these plugin configs, mainly because plugins were wiped out
+IGNORE = (
+ "FreakshareNet", "SpeedManager", "ArchiveTo", "ShareCx", ('hooks', 'UnRar'),
+ 'EasyShareCom', 'FlyshareCz'
+ )
CONF_VERSION = 1
@@ -34,7 +37,7 @@ class ConfigParser:
"""
- #----------------------------------------------------------------------
+
def __init__(self):
"""Constructor"""
self.config = {} # the config values
@@ -49,7 +52,7 @@ class ConfigParser:
self.deleteOldPlugins()
- #----------------------------------------------------------------------
+
def checkVersion(self, n=0):
"""determines if config need to be copied"""
try:
@@ -87,7 +90,6 @@ class ConfigParser:
else:
raise
- #----------------------------------------------------------------------
def readConfig(self):
"""reads the config file"""
@@ -108,7 +110,7 @@ class ConfigParser:
print "Config Warning"
print_exc()
- #----------------------------------------------------------------------
+
def parseConfig(self, config):
"""parses a given configfile"""
@@ -126,8 +128,7 @@ class ConfigParser:
for line in config:
comment = line.rfind("#")
- if line.find(":", comment) < 0 and line.find("=", comment) < 0 and comment > 0 and line[
- comment - 1].isspace():
+ if line.find(":", comment) < 0 > line.find("=", comment) and comment > 0 and line[comment - 1].isspace():
line = line.rpartition("#") # removes comments
if line[1]:
line = line[0]
@@ -193,7 +194,6 @@ class ConfigParser:
return conf
- #----------------------------------------------------------------------
def updateValues(self, config, dest):
"""sets the config values from a parsed config file to values in destination"""
@@ -212,7 +212,6 @@ class ConfigParser:
#else:
# dest[section] = config[section]
- #----------------------------------------------------------------------
def saveConfig(self, config, filename):
"""saves config to filename"""
with open(filename, "wb") as f:
@@ -260,19 +259,19 @@ class ConfigParser:
else:
return value
- #----------------------------------------------------------------------
+
def save(self):
"""saves the configs to disk"""
self.saveConfig(self.config, "pyload.conf")
self.saveConfig(self.plugin, "plugin.conf")
- #----------------------------------------------------------------------
+
def __getitem__(self, section):
"""provides dictonary like access: c['section']['option']"""
return Section(self, section)
- #----------------------------------------------------------------------
+
def get(self, section, option):
"""get value"""
val = self.config[section][option]["value"]
@@ -317,7 +316,6 @@ class ConfigParser:
""" get all config data for an option """
return self.config[section][option]
- #----------------------------------------------------------------------
def addPluginConfig(self, name, config, outline=""):
"""adds config options with tuples (name, type, desc, default)"""
if name not in self.plugin:
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py
index cf01ba5d8..09d5f58e7 100644
--- a/module/plugins/PluginManager.py
+++ b/module/plugins/PluginManager.py
@@ -357,6 +357,8 @@ class PluginManager:
self.core.accountManager.initPlugins()
self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos)
+ return True
+
if __name__ == "__main__":
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 47fb419e7..97c9ec64b 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -83,14 +83,17 @@ class Core(object):
if len(argv) > 1:
try:
- options, args = getopt(argv[1:], 'vchdusq',
- ["version", "clear", "clean", "help", "debug", "user", "setup", "configdir=", "changedir", "daemon",
- "quit", "status", "no-remote"])
+ options, args = getopt(argv[1:], 'vchdusqp:',
+ ["version", "clear", "clean", "help", "debug", "user",
+ "setup", "configdir=", "changedir", "daemon",
+ "quit", "status", "no-remote","pidfile="])
for option, argument in options:
if option in ("-v", "--version"):
print "pyLoad", CURRENT_VERSION
exit()
+ elif option in ("-p", "--pidfile"):
+ self.pidfile = argument
elif option == "--daemon":
self.daemon = True
elif option in ("-c", "--clear"):
@@ -159,9 +162,10 @@ class Core(object):
print " -d, --debug", " " * 12, "Enable debug mode"
print " -s, --setup", " " * 12, "Run Setup Assistent"
print " --configdir=<dir>", " " * 6, "Run with <dir> as config directory"
+ print " -p, --pidfile=<file>", " " * 3, "Set pidfile to <file>"
print " --changedir", " " * 12, "Change config dir permanently"
print " --daemon", " " * 15, "Daemonmize after start"
- print " --no-remote", " " * 14, "Disable remote access (saves RAM)"
+ print " --no-remote", " " * 12, "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"