def _insert_paths(cls, distribution, libraries_path): # Display platform details p_bits, _ = platform.architecture() p_machine = platform.machine() log.debug('Bits: %r, Machine: %r', p_bits, p_machine) # Retrieve system details system = SystemHelper.name() architecture = SystemHelper.architecture() if not architecture: InterfaceMessages.add(60, 'Unable to retrieve system architecture') return False log.debug('System: %r, Architecture: %r', system, architecture) # Build architecture list architectures = [architecture] if architecture == 'i686': # Fallback to i386 architectures.append('i386') # Insert library paths found = False for arch in architectures + ['universal']: if cls._insert_architecture_paths(libraries_path, system, arch): log.debug('Inserted libraries path for system: %r, arch: %r', system, arch) found = True # Display interface message if no libraries were found if not found: if distribution and distribution.get('name'): message = 'Unable to find compatible native libraries in the %s distribution' % distribution[ 'name'] else: message = 'Unable to find compatible native libraries' InterfaceMessages.add(60, '%s (system: %r, architecture: %r)', message, system, architecture) return found
def _insert_paths(cls, distribution, libraries_path): # Display platform details p_bits, _ = platform.architecture() p_machine = platform.machine() log.debug('Bits: %r, Machine: %r', p_bits, p_machine) # Retrieve system details system = SystemHelper.name() architecture = SystemHelper.architecture() if not architecture: InterfaceMessages.add(60, 'Unable to retrieve system architecture') return False log.debug('System: %r, Architecture: %r', system, architecture) # Build architecture list architectures = [architecture] if architecture == 'i686': # Fallback to i386 architectures.append('i386') # Insert library paths found = False for arch in architectures + ['universal']: if cls._insert_architecture_paths(libraries_path, system, arch): log.debug('Inserted libraries path for system: %r, arch: %r', system, arch) found = True # Display interface message if no libraries were found if not found: if distribution and distribution.get('name'): message = 'Unable to find compatible native libraries in the %s distribution' % distribution['name'] else: message = 'Unable to find compatible native libraries' InterfaceMessages.add(60, '%s (system: %r, architecture: %r)', message, system, architecture) return found
List, Playback, Ratings, Watched ] MODES = [ FastPull, Full, Pull, Push ] # Display error if the system timezone is not available if TZ_LOCAL is None: InterfaceMessages.add(logging.ERROR, 'Unable to retrieve system timezone, syncing will not be available') class Main(object): def __init__(self): self.current = None self._queue = Queue.PriorityQueue() self._queue_lock = Lock() self._spawn_lock = Lock() self._thread = None # Triggers self._library_update = LibraryUpdateTrigger(self)
# ------------------------------------------------ # Logger # ------------------------------------------------ from plugin.core.logger import LoggerManager LoggerManager.setup(storage=False) # ------------------------------------------------ # Interface messages # ------------------------------------------------ from plugin.core.message import InterfaceMessages InterfaceMessages.bind() # ------------------------------------------------ # Language # ------------------------------------------------ Environment.setup_locale() Environment.setup_translation() # ------------------------------------------------ # Libraries # ------------------------------------------------ from plugin.core.libraries.manager import LibrariesManager LibrariesManager.setup(cache=True) LibrariesManager.test() # ------------------------------------------------ # Warnings
from threading import Lock, Thread import logging import Queue import sys import time log = logging.getLogger(__name__) HANDLERS = [Collection, List, Playback, Ratings, Watched] MODES = [FastPull, Full, Pull, Push] # Display error if the system timezone is not available if TZ_LOCAL is None: InterfaceMessages.add( logging.ERROR, 'Unable to retrieve system timezone, syncing will not be available') class Main(object): def __init__(self): self.current = None self._queue = Queue.PriorityQueue() self._queue_lock = Lock() self._spawn_lock = Lock() self._thread = None # Triggers self._library_update = LibraryUpdateTrigger(self)