fix: showing warning for not enabled gems

This commit is contained in:
Vinicius Moreira
2019-09-18 15:03:43 -03:00
parent 4aec5a436a
commit ad3c1fb098
2 changed files with 8 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ EXTRA_INSTALLED_ACTIONS = [
requires_root=True)
]
KNOWN_APP_NAMES = {'gnome-calculator', 'gnome-system-monitor'}
KNOWN_RUNTIME_NAMES = {'snapd', 'core', 'core18', 'snapcraft', 'multipass'}
KNOWN_RUNTIME_PREFIXES = {'gtk-', 'gnome-', 'kde-', 'gtk2-'}
KNOWN_RUNTIME_TYPES = {'base', 'core', 'os'}
@@ -50,7 +51,7 @@ class SnapApplication(SoftwarePackage):
return self.get_default_icon_path()
def is_application(self):
return not self.type and (self.name not in KNOWN_RUNTIME_NAMES and self.type not in KNOWN_RUNTIME_TYPES and not self._name_starts_with(KNOWN_RUNTIME_PREFIXES))
return not self.type and (self.name in KNOWN_APP_NAMES) or (self.name not in KNOWN_RUNTIME_NAMES and self.type not in KNOWN_RUNTIME_TYPES and not self._name_starts_with(KNOWN_RUNTIME_PREFIXES))
def _name_starts_with(self, words: set):
for word in words:

View File

@@ -269,13 +269,14 @@ class GenericSoftwareManager(SoftwareManager):
if self.managers:
for man in self.managers:
man_warnings = man.list_warnings()
if man.is_enabled():
man_warnings = man.list_warnings()
if man_warnings:
if warnings is None:
warnings = []
if man_warnings:
if warnings is None:
warnings = []
warnings.extend(man_warnings)
warnings.extend(man_warnings)
return warnings