mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 18:54:16 +02:00
fix: showing warning for not enabled gems
This commit is contained in:
@@ -13,6 +13,7 @@ EXTRA_INSTALLED_ACTIONS = [
|
|||||||
requires_root=True)
|
requires_root=True)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
KNOWN_APP_NAMES = {'gnome-calculator', 'gnome-system-monitor'}
|
||||||
KNOWN_RUNTIME_NAMES = {'snapd', 'core', 'core18', 'snapcraft', 'multipass'}
|
KNOWN_RUNTIME_NAMES = {'snapd', 'core', 'core18', 'snapcraft', 'multipass'}
|
||||||
KNOWN_RUNTIME_PREFIXES = {'gtk-', 'gnome-', 'kde-', 'gtk2-'}
|
KNOWN_RUNTIME_PREFIXES = {'gtk-', 'gnome-', 'kde-', 'gtk2-'}
|
||||||
KNOWN_RUNTIME_TYPES = {'base', 'core', 'os'}
|
KNOWN_RUNTIME_TYPES = {'base', 'core', 'os'}
|
||||||
@@ -50,7 +51,7 @@ class SnapApplication(SoftwarePackage):
|
|||||||
return self.get_default_icon_path()
|
return self.get_default_icon_path()
|
||||||
|
|
||||||
def is_application(self):
|
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):
|
def _name_starts_with(self, words: set):
|
||||||
for word in words:
|
for word in words:
|
||||||
|
|||||||
@@ -269,13 +269,14 @@ class GenericSoftwareManager(SoftwareManager):
|
|||||||
|
|
||||||
if self.managers:
|
if self.managers:
|
||||||
for man in 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 man_warnings:
|
||||||
if warnings is None:
|
if warnings is None:
|
||||||
warnings = []
|
warnings = []
|
||||||
|
|
||||||
warnings.extend(man_warnings)
|
warnings.extend(man_warnings)
|
||||||
|
|
||||||
return warnings
|
return warnings
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user