mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 20:34:16 +02:00
[improvement][ui] sorting installed packages by their names
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
env
|
||||
venv
|
||||
*.pyc
|
||||
.idea
|
||||
__pycache__
|
||||
@@ -6,4 +7,4 @@ __pycache__
|
||||
dist
|
||||
*.egg-info
|
||||
build
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- not performing a full table refresh after installing and uninstalling packages
|
||||
- filters algorithm speed and sorting
|
||||
- displaying wait cursor over some components
|
||||
- sorting installed packages by their names
|
||||
|
||||
### Fixes
|
||||
- AppImage
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import re
|
||||
import operator
|
||||
import re
|
||||
import time
|
||||
import traceback
|
||||
@@ -200,6 +200,9 @@ class GenericSoftwareManager(SoftwareManager):
|
||||
def can_work(self) -> bool:
|
||||
return True
|
||||
|
||||
def _get_package_lower_name(self, pkg: SoftwarePackage):
|
||||
return pkg.name.lower()
|
||||
|
||||
def read_installed(self, disk_loader: DiskCacheLoader = None, limit: int = -1, only_apps: bool = False, pkg_types: Set[Type[SoftwarePackage]] = None, internet_available: bool = None) -> SearchResult:
|
||||
ti = time.time()
|
||||
self._wait_to_be_ready()
|
||||
@@ -254,6 +257,8 @@ class GenericSoftwareManager(SoftwareManager):
|
||||
elif 'updates_ignored' not in p.categories:
|
||||
p.categories.append('updates_ignored')
|
||||
|
||||
res.installed.sort(key=self._get_package_lower_name)
|
||||
|
||||
tf = time.time()
|
||||
self.logger.info('Took {0:.2f} seconds'.format(tf - ti))
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user