diff --git a/couchpotato/core/_base/_core/main.py b/couchpotato/core/_base/_core.py similarity index 63% rename from couchpotato/core/_base/_core/main.py rename to couchpotato/core/_base/_core.py index 02e21f2d..ee266512 100644 --- a/couchpotato/core/_base/_core/main.py +++ b/couchpotato/core/_base/_core.py @@ -15,6 +15,8 @@ import webbrowser log = CPLog(__name__) +autoload = 'Core' + class Core(Plugin): @@ -186,3 +188,99 @@ class Core(Plugin): signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) + + +config = [{ + 'name': 'core', + 'order': 1, + 'groups': [ + { + 'tab': 'general', + 'name': 'basics', + 'description': 'Needs restart before changes take effect.', + 'wizard': True, + 'options': [ + { + 'name': 'username', + 'default': '', + }, + { + 'name': 'password', + 'default': '', + 'type': 'password', + }, + { + 'name': 'port', + 'default': 5050, + 'type': 'int', + 'description': 'The port I should listen to.', + }, + { + 'name': 'ssl_cert', + 'description': 'Path to SSL server.crt', + 'advanced': True, + }, + { + 'name': 'ssl_key', + 'description': 'Path to SSL server.key', + 'advanced': True, + }, + { + 'name': 'launch_browser', + 'default': True, + 'type': 'bool', + 'description': 'Launch the browser when I start.', + 'wizard': True, + }, + ], + }, + { + 'tab': 'general', + 'name': 'advanced', + 'description': "For those who know what they're doing", + 'advanced': True, + 'options': [ + { + 'name': 'api_key', + 'default': uuid4().hex, + 'readonly': 1, + 'description': 'Let 3rd party app do stuff. Docs', + }, + { + 'name': 'debug', + 'default': 0, + 'type': 'bool', + 'description': 'Enable debugging.', + }, + { + 'name': 'development', + 'default': 0, + 'type': 'bool', + 'description': 'Enable this if you\'re developing, and NOT in any other case, thanks.', + }, + { + 'name': 'data_dir', + 'type': 'directory', + 'description': 'Where cache/logs/etc are stored. Keep empty for defaults.', + }, + { + 'name': 'url_base', + 'default': '', + 'description': 'When using mod_proxy use this to append the url with this.', + }, + { + 'name': 'permission_folder', + 'default': '0755', + 'label': 'Folder CHMOD', + 'description': 'Can be either decimal (493) or octal (leading zero: 0755)', + }, + { + 'name': 'permission_file', + 'default': '0755', + 'label': 'File CHMOD', + 'description': 'Same as Folder CHMOD but for files', + }, + ], + }, + ], +}] diff --git a/couchpotato/core/_base/_core/__init__.py b/couchpotato/core/_base/_core/__init__.py deleted file mode 100644 index 58965bbb..00000000 --- a/couchpotato/core/_base/_core/__init__.py +++ /dev/null @@ -1,101 +0,0 @@ -from .main import Core -from uuid import uuid4 - - -def start(): - return Core() - -config = [{ - 'name': 'core', - 'order': 1, - 'groups': [ - { - 'tab': 'general', - 'name': 'basics', - 'description': 'Needs restart before changes take effect.', - 'wizard': True, - 'options': [ - { - 'name': 'username', - 'default': '', - }, - { - 'name': 'password', - 'default': '', - 'type': 'password', - }, - { - 'name': 'port', - 'default': 5050, - 'type': 'int', - 'description': 'The port I should listen to.', - }, - { - 'name': 'ssl_cert', - 'description': 'Path to SSL server.crt', - 'advanced': True, - }, - { - 'name': 'ssl_key', - 'description': 'Path to SSL server.key', - 'advanced': True, - }, - { - 'name': 'launch_browser', - 'default': True, - 'type': 'bool', - 'description': 'Launch the browser when I start.', - 'wizard': True, - }, - ], - }, - { - 'tab': 'general', - 'name': 'advanced', - 'description': "For those who know what they're doing", - 'advanced': True, - 'options': [ - { - 'name': 'api_key', - 'default': uuid4().hex, - 'readonly': 1, - 'description': 'Let 3rd party app do stuff. Docs', - }, - { - 'name': 'debug', - 'default': 0, - 'type': 'bool', - 'description': 'Enable debugging.', - }, - { - 'name': 'development', - 'default': 0, - 'type': 'bool', - 'description': 'Enable this if you\'re developing, and NOT in any other case, thanks.', - }, - { - 'name': 'data_dir', - 'type': 'directory', - 'description': 'Where cache/logs/etc are stored. Keep empty for defaults.', - }, - { - 'name': 'url_base', - 'default': '', - 'description': 'When using mod_proxy use this to append the url with this.', - }, - { - 'name': 'permission_folder', - 'default': '0755', - 'label': 'Folder CHMOD', - 'description': 'Can be either decimal (493) or octal (leading zero: 0755)', - }, - { - 'name': 'permission_file', - 'default': '0755', - 'label': 'File CHMOD', - 'description': 'Same as Folder CHMOD but for files', - }, - ], - }, - ], -}] diff --git a/couchpotato/core/_base/clientscript/main.py b/couchpotato/core/_base/clientscript.py similarity index 99% rename from couchpotato/core/_base/clientscript/main.py rename to couchpotato/core/_base/clientscript.py index c1be7e73..42ad28af 100644 --- a/couchpotato/core/_base/clientscript/main.py +++ b/couchpotato/core/_base/clientscript.py @@ -13,6 +13,8 @@ import traceback log = CPLog(__name__) +autoload = 'ClientScript' + class ClientScript(Plugin): diff --git a/couchpotato/core/_base/clientscript/__init__.py b/couchpotato/core/_base/clientscript/__init__.py deleted file mode 100644 index 8070044e..00000000 --- a/couchpotato/core/_base/clientscript/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .main import ClientScript - - -def start(): - return ClientScript() - -config = [] diff --git a/couchpotato/core/_base/desktop/main.py b/couchpotato/core/_base/desktop.py similarity index 97% rename from couchpotato/core/_base/desktop/main.py rename to couchpotato/core/_base/desktop.py index c3beff17..9a365636 100644 --- a/couchpotato/core/_base/desktop/main.py +++ b/couchpotato/core/_base/desktop.py @@ -5,6 +5,9 @@ from couchpotato.environment import Env log = CPLog(__name__) +autoload = 'Desktop' + + if Env.get('desktop'): class Desktop(Plugin): diff --git a/couchpotato/core/_base/desktop/__init__.py b/couchpotato/core/_base/desktop/__init__.py deleted file mode 100644 index e59ca523..00000000 --- a/couchpotato/core/_base/desktop/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .main import Desktop - - -def start(): - return Desktop() - -config = [] diff --git a/couchpotato/core/_base/scheduler/main.py b/couchpotato/core/_base/scheduler.py similarity index 99% rename from couchpotato/core/_base/scheduler/main.py rename to couchpotato/core/_base/scheduler.py index 3d835f94..ae5bfd3b 100644 --- a/couchpotato/core/_base/scheduler/main.py +++ b/couchpotato/core/_base/scheduler.py @@ -5,6 +5,8 @@ from couchpotato.core.plugins.base import Plugin log = CPLog(__name__) +autoload = 'Scheduler' + class Scheduler(Plugin): diff --git a/couchpotato/core/_base/scheduler/__init__.py b/couchpotato/core/_base/scheduler/__init__.py deleted file mode 100644 index abfc2305..00000000 --- a/couchpotato/core/_base/scheduler/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .main import Scheduler - - -def start(): - return Scheduler() - -config = [] diff --git a/couchpotato/core/_base/updater/__init__.py b/couchpotato/core/_base/updater/__init__.py index 7ad30d27..a62eafb5 100644 --- a/couchpotato/core/_base/updater/__init__.py +++ b/couchpotato/core/_base/updater/__init__.py @@ -3,7 +3,7 @@ from couchpotato.environment import Env import os -def start(): +def autoload(): return Updater() config = [{