Ejemplo n.º 1
0
    def __init__(self, core):
        """
        Constructor.
        """
        BaseManager.__init__(self, core)

        # PluginName mapped to list of account instances
        self.accounts = {}

        self.load_accounts()
Ejemplo n.º 2
0
    def __init__(self, core):
        BaseManager.__init__(self, core)

        # won't start download when true
        self.pause = True

        # each thread is in exactly one category
        self.free = []
        # a thread that in working must have a file as active attribute
        self.downloading = []
        # holds the decrypter threads
        self.decrypting = []

        # indicates when reconnect has occurred
        self.reconnecting = Event()

        self.lock = RWLock()
Ejemplo n.º 3
0
    def __init__(self, core):
        BaseManager.__init__(self, core)

        # needed to let addons register themselves
        builtins.ADDONMANAGER = self

        # TODO: multiuser addons

        # maps plugin names to info tuple
        self.plugins = defaultdict(lambda: AddonTuple([], [], {}))
        # Property hash mapped to meta data
        self.info_props = {}

        self.lock = RLock()
        self.create_index()

        # manage addons on config change
        self.listen_to("config:changed", self.manage_addon)
Ejemplo n.º 4
0
    def __init__(self, core):
        """
        Constructor.
        """
        BaseManager.__init__(self, core)

        # translations
        self.status_msg = [
            self._("none"),
            self._("offline"),
            self._("online"),
            self._("queued"),
            self._("paused"),
            self._("finished"),
            self._("skipped"),
            self._("failed"),
            self._("starting"),
            self._("waiting"),
            self._("downloading"),
            self._("temp. offline"),
            self._("aborted"),
            self._("not possible"),
            self._("missing"),
            self._("file mismatch"),
            self._("occupied"),
            self._("decrypting"),
            self._("processing"),
            self._("custom"),
            self._("unknown")
        ]

        self.files = {}  # holds instances for files
        self.packages = {}  # same for packages

        self.job_cache = {}

        # locking the caches, db is already locked implicit
        self.lock = RWLock()
        # self.lock._Verbose__verbose = True

        self.downloadstats = {}  # cached dl stats
        self.queuestats = {}  # cached queue stats

        self.db = self.pyload_core.db
Ejemplo n.º 5
0
    def __init__(self, core):
        """
        Constructor.
        """
        BaseManager.__init__(self, core)

        self.thread = []  # thread list

        self.lock = RLock()

        # some operations require to fetch url info from hoster,
        # so we caching them so it wont be done twice
        # contains a timestamp and will be purged after timeout
        self.info_cache = {}

        # pool of ids for online check
        self.result_ids = 0

        # saved online checks
        self.info_results = {}

        # timeout for cache purge
        self.timestamp = 0
Ejemplo n.º 6
0
    def __init__(self, core):
        BaseManager.__init__(self, core)

        # cached modules (type, name)
        self.modules = {}
        # match history to speedup parsing (type, name)
        self.history = []

        # register for import addon
        sys.meta_path.append(self)

        # add to path, so we can import from userplugins
        sys.path.append(os.getcwd())  # TODO: Recheck...
        self.loader = LoaderFactory(
            PluginLoader(fullpath(self.LOCALROOT), self.LOCALROOT,
                         self.pyload_core.config),
            PluginLoader(resource_filename(__package__, 'network')), self.ROOT,
            self.pyload_core.config)

        self.loader.check_versions()

        # plugin matcher to overwrite some behaviour
        self.matcher = []
Ejemplo n.º 7
0
 def __init__(self, core):
     BaseManager.__init__(self, core)
     self.backends = []
Ejemplo n.º 8
0
 def __init__(self, core):
     BaseManager.__init__(self, core)
     self.tasks = OrderedDict()  # task store, for all outgoing tasks
     self.last_clients = {}
     self.ids = 0  # uniue interaction ids
Ejemplo n.º 9
0
 def __init__(self, core):
     BaseManager.__init__(self, core)
     self.events = {'event': []}