Beispiel #1
0
from bauh.gems.arch import ROOT_DIR, ARCH_CACHE_PATH
from bauh.view.util.translation import I18n

CACHED_ATTRS = {
    'command', 'icon_path', 'repository', 'maintainer', 'desktop_entry',
    'categories', 'last_modified', 'commit'
}

ACTIONS_AUR_ENABLE_PKGBUILD_EDITION = [
    CustomSoftwareAction(
        i18n_label_key='arch.action.enable_pkgbuild_edition',
        i18n_status_key='arch.action.enable_pkgbuild_edition.status',
        i18n_confirm_key='arch.action.enable_pkgbuild_edition.confirm',
        requires_root=False,
        manager_method='enable_pkgbuild_edition',
        icon_path=resource.get_path('img/mark_pkgbuild.svg', ROOT_DIR))
]

ACTIONS_AUR_DISABLE_PKGBUILD_EDITION = [
    CustomSoftwareAction(
        i18n_label_key='arch.action.disable_pkgbuild_edition',
        i18n_status_key='arch.action.disable_pkgbuild_edition',
        i18n_confirm_key='arch.action.disable_pkgbuild_edition.confirm',
        requires_root=False,
        manager_method='disable_pkgbuild_edition',
        icon_path=resource.get_path('img/unmark_pkgbuild.svg', ROOT_DIR))
]


class ArchPackage(SoftwarePackage):
    def __init__(self,
Beispiel #2
0
def get_repo_icon_path() -> str:
    return resource.get_path('img/repo.svg', ROOT_DIR)
Beispiel #3
0
 def get_default_icon_path(self):
     return resource.get_path('img/snap.svg', ROOT_DIR)
Beispiel #4
0
 def get_type_icon_path(self):
     return resource.get_path('img/appimage.svg', ROOT_DIR)
Beispiel #5
0
def get_icon_path() -> str:
    return resource.get_path('img/arch.svg', ROOT_DIR)
Beispiel #6
0
 def get_default_icon_path(self) -> str:
     return resource.get_path('img/web.svg', ROOT_DIR)
Beispiel #7
0
from typing import List

from bauh.api.abstract.model import SoftwarePackage, CustomSoftwareAction
from bauh.commons import resource
from bauh.gems.snap import ROOT_DIR

EXTRA_INSTALLED_ACTIONS = [
    CustomSoftwareAction(i18n_status_key='snap.action.refresh.status',
                         i18_label_key='snap.action.refresh.label',
                         icon_path=resource.get_path('img/refresh.svg', ROOT_DIR),
                         manager_method='refresh',
                         requires_root=True)
]

KNOWN_RUNTIME_NAMES = {'snapd', 'snapcraft', 'multipass'}


class SnapApplication(SoftwarePackage):

    def __init__(self, id: str = None, name: str = None, version: str = None, latest_version: str = None,
                 description: str = None, publisher: str = None, rev: str = None, notes: str = None,
                 confinement: str = None, has_apps_field: bool = None, verified_publisher: bool = False):
        super(SnapApplication, self).__init__(id=id, name=name, version=version,
                                              latest_version=latest_version, description=description)
        self.publisher = publisher
        self.rev = rev
        self.notes = notes
        self.confinement = confinement
        self.has_apps_field = has_apps_field
        self.verified_publisher = verified_publisher
Beispiel #8
0
def _get_repo_icon(repository: str):
    return resource.get_path('img/{}.svg'.format('arch' if repository == 'aur' else 'repo'), ROOT_DIR)
Beispiel #9
0
 def get_type_icon_path(self):
     return resource.get_path(
         'img/{}.svg'.format('arch' if self.get_type() ==
                             'aur' else 'repo'), ROOT_DIR)
Beispiel #10
0
def _get_mirror_icon(mirror: str):
    return resource.get_path('img/{}.png'.format('arch' if mirror == 'aur' else 'mirror'), ROOT_DIR)