mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
[improvement][ui] sorting installed packages by their names
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
env
|
env
|
||||||
|
venv
|
||||||
*.pyc
|
*.pyc
|
||||||
.idea
|
.idea
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|||||||
@@ -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
|
- not performing a full table refresh after installing and uninstalling packages
|
||||||
- filters algorithm speed and sorting
|
- filters algorithm speed and sorting
|
||||||
- displaying wait cursor over some components
|
- displaying wait cursor over some components
|
||||||
|
- sorting installed packages by their names
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- AppImage
|
- AppImage
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import re
|
import operator
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
@@ -200,6 +200,9 @@ class GenericSoftwareManager(SoftwareManager):
|
|||||||
def can_work(self) -> bool:
|
def can_work(self) -> bool:
|
||||||
return True
|
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:
|
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()
|
ti = time.time()
|
||||||
self._wait_to_be_ready()
|
self._wait_to_be_ready()
|
||||||
@@ -254,6 +257,8 @@ class GenericSoftwareManager(SoftwareManager):
|
|||||||
elif 'updates_ignored' not in p.categories:
|
elif 'updates_ignored' not in p.categories:
|
||||||
p.categories.append('updates_ignored')
|
p.categories.append('updates_ignored')
|
||||||
|
|
||||||
|
res.installed.sort(key=self._get_package_lower_name)
|
||||||
|
|
||||||
tf = time.time()
|
tf = time.time()
|
||||||
self.logger.info('Took {0:.2f} seconds'.format(tf - ti))
|
self.logger.info('Took {0:.2f} seconds'.format(tf - ti))
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user