mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 19:04:15 +02:00
snaps -> Improved how the the application verification is done
This commit is contained in:
@@ -9,10 +9,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- AppImage support ( see below )
|
- AppImage support ( see below )
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
- AUR:
|
|
||||||
- Optional dependencies are not checked by default in their installation popup.
|
|
||||||
- Flatpak:
|
- Flatpak:
|
||||||
- History panel now shows formatted dates
|
- History panel now shows formatted dates
|
||||||
|
- Snap:
|
||||||
|
- Improved how the the application verification is done ( if a given Snap is an application )
|
||||||
|
- AUR:
|
||||||
|
- Optional dependencies are not checked by default in their installation popup.
|
||||||
- History panel can now me maximized, minimized and allows to copy column content.
|
- History panel can now me maximized, minimized and allows to copy column content.
|
||||||
- Minor UI improvements
|
- Minor UI improvements
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class SnapManager(SoftwareManager):
|
|||||||
app = SnapApplication(publisher=app_json.get('publisher'),
|
app = SnapApplication(publisher=app_json.get('publisher'),
|
||||||
rev=app_json.get('rev'),
|
rev=app_json.get('rev'),
|
||||||
notes=app_json.get('notes'),
|
notes=app_json.get('notes'),
|
||||||
app_type=app_json.get('type'),
|
has_apps_field=app_json.get('apps_field', False),
|
||||||
id=app_json.get('name'),
|
id=app_json.get('name'),
|
||||||
name=app_json.get('name'),
|
name=app_json.get('name'),
|
||||||
version=app_json.get('version'),
|
version=app_json.get('version'),
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ class SnapApplication(SoftwarePackage):
|
|||||||
|
|
||||||
def __init__(self, id: str = None, name: str = None, version: str = None, latest_version: str = None,
|
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,
|
description: str = None, publisher: str = None, rev: str = None, notes: str = None,
|
||||||
app_type: str = None, confinement: str = None):
|
confinement: str = None, has_apps_field: bool = None):
|
||||||
super(SnapApplication, self).__init__(id=id, name=name, version=version,
|
super(SnapApplication, self).__init__(id=id, name=name, version=version,
|
||||||
latest_version=latest_version, description=description)
|
latest_version=latest_version, description=description)
|
||||||
self.publisher = publisher
|
self.publisher = publisher
|
||||||
self.rev = rev
|
self.rev = rev
|
||||||
self.notes = notes
|
self.notes = notes
|
||||||
self.type = app_type
|
|
||||||
self.confinement = confinement
|
self.confinement = confinement
|
||||||
|
self.has_apps_field = has_apps_field
|
||||||
|
|
||||||
def has_history(self):
|
def has_history(self):
|
||||||
return False
|
return False
|
||||||
@@ -50,8 +50,8 @@ class SnapApplication(SoftwarePackage):
|
|||||||
def get_type_icon_path(self):
|
def get_type_icon_path(self):
|
||||||
return self.get_default_icon_path()
|
return self.get_default_icon_path()
|
||||||
|
|
||||||
def is_application(self):
|
def is_application(self) -> bool:
|
||||||
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))
|
return self.has_apps_field is None or self.has_apps_field
|
||||||
|
|
||||||
def _name_starts_with(self, words: set):
|
def _name_starts_with(self, words: set):
|
||||||
for word in words:
|
for word in words:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ def read_installed() -> List[dict]:
|
|||||||
info_out = new_subprocess(['cat', *['/var/lib/snapd/snap/{}/current/meta/snap.yaml'.format(a['name']) for a in apps]]).stdout
|
info_out = new_subprocess(['cat', *['/var/lib/snapd/snap/{}/current/meta/snap.yaml'.format(a['name']) for a in apps]]).stdout
|
||||||
|
|
||||||
idx = -1
|
idx = -1
|
||||||
for o in new_subprocess(['grep', '-E', '(summary|type)', '--colour=never'], stdin=info_out).stdout:
|
for o in new_subprocess(['grep', '-E', '(summary|apps)', '--colour=never'], stdin=info_out).stdout:
|
||||||
if o:
|
if o:
|
||||||
line = o.decode()
|
line = o.decode()
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ def read_installed() -> List[dict]:
|
|||||||
idx += 1
|
idx += 1
|
||||||
apps[idx]['summary'] = line.split(':')[1].strip()
|
apps[idx]['summary'] = line.split(':')[1].strip()
|
||||||
else:
|
else:
|
||||||
apps[idx]['type'] = line.split(':')[1].strip()
|
apps[idx]['apps_field'] = True
|
||||||
|
|
||||||
return apps
|
return apps
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user