Exemplo n.º 1
0
    def run(self):
        # Check for authentication token
        log.info('X-Plex-Token: %s',
                 'available' if os.environ.get('PLEXTOKEN') else 'unavailable')

        # Process server startup state
        self.process_server_state()

        # Start new-style modules
        module_start()

        # Start modules
        names = []

        for module in self.modules:
            if not hasattr(module, 'start'):
                continue

            names.append(get_class_name(module))

            module.start()

        log.info('Started %s modules: %s', len(names), ', '.join(names))

        ModuleManager.start()

        # Start plex.activity.py
        Activity.start(ACTIVITY_MODE.get(Preferences.get('activity.mode')))
Exemplo n.º 2
0
    def run(self):
        # Check for authentication token
        log.info('X-Plex-Token: %s', 'available' if os.environ.get('PLEXTOKEN') else 'unavailable')

        # Process server startup state
        self.process_server_state()

        # Start new-style modules
        module_start()

        # Start modules
        names = []

        for module in self.modules:
            if not hasattr(module, 'start'):
                continue

            names.append(get_class_name(module))

            module.start()

        log.info('Started %s modules: %s', len(names), ', '.join(names))

        ModuleManager.start()

        # Start plex.activity.py
        Activity.start(ACTIVITY_MODE.get(Preferences.get('activity.mode')))
Exemplo n.º 3
0
    def __init__(self):
        Header.show(self)

        LoggerManager.refresh()

        self.init_trakt()
        self.init_plex()
        self.init()

        ModuleManager.initialize()
Exemplo n.º 4
0
    def __init__(self):
        Header.show(self)

        # Initial configuration update
        self.on_configuration_changed()

        # Initialize clients
        self.init_trakt()
        self.init_plex()
        self.init()

        # Initialize modules
        ModuleManager.initialize()
Exemplo n.º 5
0
    def __init__(self):
        Header.show(self)

        # Initial configuration update
        self.on_configuration_changed()

        # Initialize clients
        self.init_trakt()
        self.init_plex()
        self.init()

        # Initialize modules
        ModuleManager.initialize()
Exemplo n.º 6
0
    def __init__(self):
        Header.show(self)

        LoggerManager.refresh()

        self.init_trakt()
        self.init_plex()
        self.init()

        ModuleManager.initialize()

        # Construct main thread
        self.thread = Thread(target=self.run, name='main')
Exemplo n.º 7
0
#
# Preferences
#

from plugin.preferences.main import Preferences

@classmethod
def preferences_get(cls, key, account=None):
    return None

# Patch `Preferences.get` method
Preferences.get = preferences_get

#
# Modules
#

from plugin.core.importer import import_modules
from plugin.modules.core.manager import ModuleManager

# ModuleManager
ModuleManager.initialize()
ModuleManager.start([
    'matcher'
])

# Scrobbler
import_modules(os.path.join(PLUGIN_DIR, 'scrobbler', 'handlers'), exclude=[
    '__init__.py'
])