Exemple #1
0
    def install(self, sender):
        for item in self.list.selected:
            Extension.install_remote(repository=item['repository'],
                                     filename=item['filename'])

        self.list.refresh()
        self.update_buttons()
Exemple #2
0
    def install(self, sender):
        for item in self.list.selected:
            Extension.install_remote(repository=item['repository'],
                                     filename=item['filename'])

        self.list.refresh()
        self.update_buttons()
Exemple #3
0
    def __init__(self, posSize, **kwargs):
        kwargs.update({
            'editCallback': self.save
        })

        configured = [e for e in Extension.all() if e.is_configured]

        super(SettingsList, self).__init__(posSize, configured, **kwargs)
Exemple #4
0
    def _get_cached(cls):
        logger.info("Fetching cached updates...")

        cache = Storage.get('update_cache')
        extensions = [Extension(name=name) for name, _ in cache.items()]

        for extension in extensions:
            if extension.is_installed and extension.is_configured:
                extension.remote.version = Version(cache[extension.name])

        return extensions
Exemple #5
0
    def _fetch_updates(cls):
        logger.info("Fetching updates...")

        try:
            updates = [e for e in Extension.all() if e.should_update]
        except requests.ConnectionError:
            raise Update.ConnectionError

        cls._set_cached(updates)
        Storage.set('last_checked_at', time.time())

        return updates
Exemple #6
0
    def _wrapItem(self, extension):
        name = extension[u'filename'].split("/")[-1]

        search = []
        if name:
            search.append(name.lower())
        if extension[u'author']:
            search.append(extension[u'author'].lower())
        if extension[u'description']:
            search.append(extension[u'description'].lower())

        item = {
            'is_installed': Extension(name=name).is_installed,
            'extension': extension,
            'search': ' '.join(search)
        }
        return super(InstallationList, self)._wrapItem(item)
Exemple #7
0
 def import_extension(self, file):
     extension = Extension(path=file[0])
     if extension.bundle.bundleExists():
         self.name.set(extension.bundle.name)
         self.filename.set(extension.filename)
         self.repository.set(extension.repository)
Exemple #8
0
 def uninstallable(self):
     filenames = [item['filename'] for item in self.list.selected]
     names = [filename.split("/")[-1] for filename in filenames]
     extensions = [Extension(name=name) for name in names]
     return [ext for ext in extensions if ext.is_installed]