Skip to content

Commit

Permalink
0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored May 12, 2020
2 parents 24cb15b + 1f05253 commit 01b1a52
Show file tree
Hide file tree
Showing 35 changed files with 385 additions and 204 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.9.3] 2020-05-12
### Features
- new **restore** action to restore all bauh settings and cache through the 'custom actions' button (**+**). It is equivalent to the command `bauh --reset`.

### Improvements
- some custom actions not related to installed packages state will not refresh the table after succeeded

### Fixes
- Arch
- "clean cache" operation was not working in some scenarios
- upgrading progress when conflicting files are detected
- not detecting some installed "not-signed" repository packages
- not properly caching data of installed dependencies
- UI
- some fields in the table are overlapped by others when maximized [#107](https://github.com/vinifmor/bauh/issues/107)

- upgrade: crashing when there are packages to be displayed on the summary window that cannot upgrade
- settings: crashing when an empty Qt style is detected or defined [#104](https://github.com/vinifmor/bauh/issues/104)


### Recommendations
- Arch-based distro users: clean the bauh's Arch cache after upgrading to this release so it will remap all installed packages during the next initialization. 3 possible ways to do it:

- type on the command line: `rm -rf ~/.cache/bauh/arch/installed` (it will reset only the Arch cache)
- type on the command line: `bauh --reset` (it will reset all caches and settings)
- click on the new **Restore** custom action on the UI (it will reset all caches and settings)


## [0.9.2] 2020-05-04
### Features
- UI
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ python3 -m venv bauh_env ( creates a virtualenv in a folder called "bauh_env" )
bauh_env/bin/pip install bauh ( installs bauh in the isolated environment )
bauh_env/bin/bauh ( launches bauh )
# P.S: if you want to launch it attached to your system tray, replace the last command by: bauh_env/bin/bauh --tray=1
# P.S: if you want to launch it attached to your system tray, replace the last command by: bauh_env/bin/bauh-tray
```

- To update your isolated bauh to the latest version:
Expand Down
2 changes: 1 addition & 1 deletion bauh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.9.2'
__version__ = '0.9.3'
__app_name__ = 'bauh'

import os
Expand Down
2 changes: 1 addition & 1 deletion bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_screenshots(self, pkg: SoftwarePackage) -> List[str]:
"""
pass

def clear_data(self):
def clear_data(self, logs: bool = True):
"""
Removes all data created by the SoftwareManager instance
"""
Expand Down
4 changes: 3 additions & 1 deletion bauh/api/abstract/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class CustomSoftwareAction:

def __init__(self, i18_label_key: str, i18n_status_key: str, icon_path: str, manager_method: str, requires_root: bool, manager: "SoftwareManager" = None, backup: bool = False):
def __init__(self, i18_label_key: str, i18n_status_key: str, icon_path: str, manager_method: str, requires_root: bool, manager: "SoftwareManager" = None, backup: bool = False, refresh: bool = True):
"""
:param i18_label_key: the i18n key that will be used to display the action name
:param i18n_status_key: the i18n key that will be used to display the action name being executed
Expand All @@ -16,6 +16,7 @@ def __init__(self, i18_label_key: str, i18n_status_key: str, icon_path: str, man
:param manager: the instance that will execute the action ( optional )
:param backup: if a system backup should be performed before executing the action
:param requires_root:
:param refresh: if the a full app refresh should be done if the action succeeds
"""
self.i18_label_key = i18_label_key
self.i18n_status_key = i18n_status_key
Expand All @@ -24,6 +25,7 @@ def __init__(self, i18_label_key: str, i18n_status_key: str, icon_path: str, man
self.requires_root = requires_root
self.manager = manager
self.backup = backup
self.refresh = refresh

def __hash__(self):
return self.i18_label_key.__hash__() + self.i18n_status_key.__hash__() + self.manager_method.__hash__()
Expand Down
4 changes: 2 additions & 2 deletions bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def wait(self):

class SimpleProcess:

def __init__(self, cmd: List[str], cwd: str = '.', expected_code: int = None,
def __init__(self, cmd: List[str], cwd: str = '.', expected_code: int = 0,
global_interpreter: bool = USE_GLOBAL_INTERPRETER, lang: str = DEFAULT_LANG, root_password: str = None,
extra_paths: Set[str] = None, error_phrases: Set[str] = None):
pwdin, final_cmd = None, []
Expand Down Expand Up @@ -179,7 +179,7 @@ def handle_simple(self, proc: SimpleProcess, output_handler=None) -> Tuple[bool,
proc.instance.wait()
output.seek(0)

success = proc.instance.returncode == proc.expected_code,
success = proc.instance.returncode == proc.expected_code
string_output = output.read()

if proc.error_phrases:
Expand Down
14 changes: 9 additions & 5 deletions bauh/gems/appimage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,19 @@ def get_screenshots(self, pkg: AppImage) -> List[str]:

return []

def clear_data(self):
def clear_data(self, logs: bool = True):
for f in glob.glob('{}/*.db'.format(LOCAL_PATH)):
try:
print('[bauh][appimage] Deleting {}'.format(f))
if logs:
print('[bauh][appimage] Deleting {}'.format(f))
os.remove(f)
print('{}[bauh][appimage] {} deleted{}'.format(Fore.YELLOW, f, Fore.RESET))

if logs:
print('{}[bauh][appimage] {} deleted{}'.format(Fore.YELLOW, f, Fore.RESET))
except:
print('{}[bauh][appimage] An exception has happened when deleting {}{}'.format(Fore.RED, f, Fore.RESET))
traceback.print_exc()
if logs:
print('{}[bauh][appimage] An exception has happened when deleting {}{}'.format(Fore.RED, f, Fore.RESET))
traceback.print_exc()

def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent:
config = read_config()
Expand Down
28 changes: 17 additions & 11 deletions bauh/gems/arch/aur.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ def search(self, words: str) -> dict:
return self.http_client.get_json(URL_SEARCH + words)

def get_info(self, names: Iterable[str]) -> List[dict]:
res = self.http_client.get_json(URL_INFO + self._map_names_as_queries(names))
return res['results'] if res and res.get('results') else []
try:
res = self.http_client.get_json(URL_INFO + self._map_names_as_queries(names))
return res['results'] if res and res.get('results') else []
except:
return []

def get_src_info(self, name: str) -> dict:
srcinfo = self.srcinfo_cache.get(name)
Expand Down Expand Up @@ -171,18 +174,21 @@ def download_names(self) -> Set[str]:
self.logger.info("Finished")

def read_index(self) -> Iterable[str]:
index = self.read_local_index()
try:
index = self.read_local_index()

if not index:
self.logger.warning("Cached AUR index file not found")
pkgnames = self.download_names()
if not index:
self.logger.warning("Cached AUR index file not found")
pkgnames = self.download_names()

if pkgnames:
return pkgnames
if pkgnames:
return pkgnames
else:
self.logger.warning("Could not load AUR index on the context")
else:
self.logger.warning("Could not load AUR index on the context")
else:
return index.values()
return index.values()
except:
return set()

def clean_caches(self):
self.srcinfo_cache.clear()
Expand Down
20 changes: 10 additions & 10 deletions bauh/gems/arch/confirmation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def request_optional_deps(pkgname: str, pkg_repos: dict, watcher: ProcessWatcher

for p, d in pkg_repos.items():
size = sizes.get(p)
op = InputOption('{}{} ( {}: {} ) - {}: {}'.format(p, ': ' + d['desc'] if d['desc'] else '',
i18n['repository'],
d['repository'].upper(),
i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), p)
op = InputOption('{}{} ({}: {}) - {}: {}'.format(p, ': ' + d['desc'] if d['desc'] else '',
i18n['repository'],
d['repository'].lower(),
i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), p)
op.icon_path = _get_repo_icon(d['repository'])
opts.append(op)

Expand Down Expand Up @@ -54,11 +54,11 @@ def request_install_missing_deps(pkgname: str, deps: List[Tuple[str, str]], watc

for dep in deps:
size = sizes.get(dep[0])
op = InputOption('{} ( {}: {} ) - {}: {}'.format(dep[0],
i18n['repository'],
dep[1].upper(),
i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), dep[0])
op = InputOption('{} ({}: {}) - {}: {}'.format(dep[0],
i18n['repository'],
dep[1].lower(),
i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), dep[0])
op.read_only = True
op.icon_path = _get_repo_icon(dep[1])
opts.append(op)
Expand Down
Loading

0 comments on commit 01b1a52

Please sign in to comment.