Esempio n. 1
0
 def __init__(self, info, repository):
     Addon.__init__(self, info, repository)
     self.script = info.script
     self.requires = [require for require in info.requires if require['addon'] not in VideoAddon.ignore_requires]
     if self.script == '':
         raise Exception("%s entry point missing in addon.xml" % self)
     # content provider
     self.downloads_path = self.get_setting('download_path')
     self.shortcuts_path = os.path.join(config.plugins.archivCZSK.dataPath.getValue(), self.id)
     self.provider = VideoAddonContentProvider(self, self.downloads_path, self.shortcuts_path)
Esempio n. 2
0
class VideoAddon(Addon):
    ignore_requires = [
        "xbmc.python", "script.module.simplejson", "script.usage.tracker"
    ]

    def __init__(self, info, repository):
        Addon.__init__(self, info, repository)
        self.script = info.script
        self.requires = [
            require for require in info.requires
            if require['addon'] not in VideoAddon.ignore_requires
        ]
        if self.script == '':
            raise Exception("%s entry point missing in addon.xml" % self)
        # content provider
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(
            config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider = VideoAddonContentProvider(self, self.downloads_path,
                                                  self.shortcuts_path)

        main = self.settings.main
        main.seekable = ConfigYesNo(default=True)
        main.pausable = ConfigYesNo(default=True)

        log.info('%s successfully loaded', self)

    def refresh_provider_paths(self, *args, **kwargs):
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(
            config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider.downloads_path = self.downloads_path
        self.provider.shortcuts_path = self.shortcuts_path

    def open_shortcuts(self, session, cb):
        def callback(*args, **kwargs):
            self.refresh_provider_paths()
            cb and cb(*args, **kwargs)

        shortcuts.openShortcuts(session, self, callback)

    def open_downloads(self, session, cb):
        def callback(*args, **kwargs):
            self.refresh_provider_paths()
            cb and cb(*args, **kwargs)

        download.openAddonDownloads(session, self, callback)

    def close(self):
        Addon.close(self)
        self.provider.close()
        self.provider = None
Esempio n. 3
0
class VideoAddon(Addon):
    ignore_requires = [
                       "xbmc.python",
                       "script.module.simplejson",
                       "script.usage.tracker"
                       ]

    def __init__(self, info, repository):
        Addon.__init__(self, info, repository)
        self.script = info.script
        self.requires = [require for require in info.requires if require['addon'] not in VideoAddon.ignore_requires]
        if self.script == '':
            raise Exception("%s entry point missing in addon.xml" % self)
        # content provider
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider = VideoAddonContentProvider(self, self.downloads_path, self.shortcuts_path)

        main = self.settings.main
        main.seekable = ConfigYesNo(default=True)
        main.pausable = ConfigYesNo(default=True)

        log.info('%s successfully loaded', self)


    def refresh_provider_paths(self, *args, **kwargs):
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider.downloads_path = self.downloads_path
        self.provider.shortcuts_path = self.shortcuts_path

    def open_shortcuts(self, session, cb):
        def callback(*args, **kwargs):
            self.refresh_provider_paths()
            cb and cb(*args, **kwargs)
        shortcuts.openShortcuts(session, self, callback)

    def open_downloads(self, session, cb):
        def callback(*args, **kwargs):
            self.refresh_provider_paths()
            cb and cb(*args, **kwargs)
        download.openAddonDownloads(session, self, callback)

    def close(self):
        Addon.close(self)
        self.provider.close()
        self.provider = None
Esempio n. 4
0
 def __init__(self, info, repository):
     Addon.__init__(self, info, repository)
     self.script = info.script
     self.requires = [require for require in info.requires if require['addon'] not in VideoAddon.ignore_requires]
     if self.script == '':
         raise Exception("%s entry point missing in addon.xml" % self)
     # content provider
     self.downloads_path = self.get_setting('download_path')
     self.shortcuts_path = os.path.join(config.plugins.archivCZSK.dataPath.getValue(), self.id)
     self.provider = VideoAddonContentProvider(self, self.downloads_path, self.shortcuts_path)
Esempio n. 5
0
    def __init__(self, info, repository):
        Addon.__init__(self, info, repository)
        self.script = info.script
        self.requires = [
            require for require in info.requires
            if require['addon'] not in VideoAddon.ignore_requires
        ]
        if self.script == '':
            raise Exception("%s entry point missing in addon.xml" % self)
        # content provider
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(
            config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider = VideoAddonContentProvider(self, self.downloads_path,
                                                  self.shortcuts_path)

        main = self.settings.main
        main.seekable = ConfigYesNo(default=True)
        main.pausable = ConfigYesNo(default=True)

        log.info('%s successfully loaded', self)
Esempio n. 6
0
    def __init__(self, info, repository):
        Addon.__init__(self, info, repository)
        self.script = info.script
        self.requires = [require for require in info.requires if require['addon'] not in VideoAddon.ignore_requires]
        if self.script == '':
            raise Exception("%s entry point missing in addon.xml" % self)
        # content provider
        self.downloads_path = self.get_setting('download_path')
        self.shortcuts_path = os.path.join(config.plugins.archivCZSK.dataPath.getValue(), self.id)
        self.provider = VideoAddonContentProvider(self, self.downloads_path, self.shortcuts_path)

        main = self.settings.main
        main.seekable = ConfigYesNo(default=True)
        main.pausable = ConfigYesNo(default=True)

        log.info('%s successfully loaded', self)