Ejemplo n.º 1
0
# ------------------------------------------------
# Environment
# ------------------------------------------------
from plugin.core.environment import Environment
import locale
import os

Environment.setup(Core, Dict, Platform, Prefs)

# plex.database.py
os.environ['LIBRARY_DB'] = os.path.join(
    Environment.path.plugin_support, 'Databases',
    'com.plexapp.plugins.library.db'
)

# locale
try:
    Log.Debug('Using locale: %s', locale.setlocale(locale.LC_ALL, ''))
except Exception, ex:
    Log.Warn('Unable to update locale: %s', ex)
# ------------------------------------------------
# FS Migrator
# ------------------------------------------------
from fs_migrator import FSMigrator

FSMigrator.run()
# ------------------------------------------------
# Logger
# ------------------------------------------------
from plugin.core.logger import LoggerManager
Ejemplo n.º 2
0
# ------------------------------------------------
# IMPORTANT
# Configure environment module before we import other modules (that could depend on it)
# ------------------------------------------------
from plugin.core.environment import Environment

# Configure environment
Environment.setup(Core)
# ------------------------------------------------

# ------------------------------------------------
# IMPORTANT
# These modules need to be loaded here first
# ------------------------------------------------
import core
import data
import pts
import sync
import interface
# ------------------------------------------------


from core.cache import CacheManager
from core.configuration import Configuration
from core.header import Header
from core.logger import Logger
from core.logging_handler import PlexHandler
from core.logging_reporter import RAVEN
from core.helpers import spawn, get_pref, schedule, get_class_name, md5
from core.plugin import ART, NAME, ICON
from core.update_checker import UpdateChecker
Ejemplo n.º 3
0
# Update `sys.path`
sys.path.insert(0, os.path.join(LIBRARIES_DIR, 'Shared'))
sys.path.insert(0, CODE_DIR)

#
# Environment
#

from plex_mock.framework import Core
from plugin.core.environment import Environment
from plugin.core.constants import PLUGIN_IDENTIFIER

# Setup environment
Environment.setup(Core(CODE_DIR), {
    'trakt.token': 'trakt.token'
}, None, {
    'username': '******',
    'password': '******'
})

# Build directory structure for "Plug-in Support"
PLUGIN_SUPPORT = os.path.join(TEMP_DIR, 'Plug-in Support')

os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Caches', PLUGIN_IDENTIFIER))
os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Data', PLUGIN_IDENTIFIER))
os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Databases'))

Environment.path.plugin_support = PLUGIN_SUPPORT

# Setup native libraries
from plugin.core.libraries import LibrariesManager
Ejemplo n.º 4
0
# ------------------------------------------------
# Environment
# ------------------------------------------------
from plugin.core.environment import Environment, translate as _
import os

Environment.setup(Core, Dict, Platform, Prefs)

# plex.database.py
os.environ['LIBRARY_DB'] = os.path.join(Environment.path.plugin_support,
                                        'Databases',
                                        'com.plexapp.plugins.library.db')

# ------------------------------------------------
# FS Migrator
# ------------------------------------------------
from fs_migrator import FSMigrator

FSMigrator.run()
# ------------------------------------------------
# Logger
# ------------------------------------------------
from plugin.core.logger import LoggerManager

LoggerManager.setup(storage=False)
# ------------------------------------------------
# Language
# ------------------------------------------------
Environment.setup_locale()
Environment.setup_translation()
# ------------------------------------------------
Ejemplo n.º 5
0
# Update `sys.path`
sys.path.insert(0, os.path.join(LIBRARIES_DIR, 'Shared'))
sys.path.insert(0, CODE_DIR)

#
# Environment
#

from plex_mock.framework import Core
from plugin.core.environment import Environment
from plugin.core.constants import PLUGIN_IDENTIFIER

# Setup environment
Environment.setup(Core(CODE_DIR), {
    'trakt.token': 'trakt.token'
}, None, {
    'username': '******',
    'password': '******'
})

# Build directory structure for "Plug-in Support"
PLUGIN_SUPPORT = os.path.join(TEMP_DIR, 'Plug-in Support')

os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Caches', PLUGIN_IDENTIFIER))
os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Data', PLUGIN_IDENTIFIER))
os.makedirs(os.path.join(PLUGIN_SUPPORT, 'Databases'))

Environment.path.plugin_support = PLUGIN_SUPPORT

# Setup native libraries
from plugin.core.libraries.manager import LibrariesManager