This commit is contained in:
Vinícius Moreira
2020-04-13 11:49:28 -03:00
parent 83aab1ff55
commit 01a60ea686
165 changed files with 12778 additions and 6171 deletions

View File

@@ -1,15 +1,15 @@
from typing import List
from bauh.api.abstract.model import SoftwarePackage, PackageAction
from bauh.api.abstract.model import SoftwarePackage, CustomSoftwareAction
from bauh.commons import resource
from bauh.gems.snap import ROOT_DIR
EXTRA_INSTALLED_ACTIONS = [
PackageAction(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)
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'}
@@ -79,6 +79,9 @@ class SnapApplication(SoftwarePackage):
def get_publisher(self):
return self.publisher
def get_custom_supported_actions(self) -> List[PackageAction]:
def get_custom_supported_actions(self) -> List[CustomSoftwareAction]:
if self.installed:
return EXTRA_INSTALLED_ACTIONS
def supports_backup(self) -> bool:
return True