Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.20 #204

Merged
merged 13 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ 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.20] 2021-11-05
### Improvements
- AppImage:
- not displaying "imported" besides the imported application name on the table (only for the name tip)

- UI:
- always displaying the "any file filter" (*) as the last option for file chooser components [#193](https://github.com/vinifmor/bauh/issues/193)

### Fixes
- General
- some backend commands could hang when require user interaction
- AppImage
- not displaying the filter for any kind of file (*) when updating imported AppImages [#193](https://github.com/vinifmor/bauh/issues/193)
- Flatpak
- not listing installed packages for Flatpak 1.2 [#201](https://github.com/vinifmor/bauh/issues/201)
- not listing updates for Flatpak 1.2
- UI
- always requesting the password on the initialization dialog when launched by the root user [#195](https://github.com/vinifmor/bauh/issues/195)


## [0.9.19] 2021-08-23
### Improvements
- AppImage
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.19'
__version__ = '0.9.20'
__app_name__ = 'bauh'

import os
Expand Down
1 change: 0 additions & 1 deletion bauh/api/abstract/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def get_text_input(self, id_) -> Optional[TextInputComponent]:
return comp



class FileChooserComponent(ViewComponent):

def __init__(self, allowed_extensions: Optional[Set[str]] = None, label: Optional[str] = None, tooltip: Optional[str] = None,
Expand Down
4 changes: 1 addition & 3 deletions bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ def _new(self, cmd: List[str], cwd: str, global_interpreter: bool, lang: str, st
args = {
"stdout": subprocess.PIPE,
"stderr": subprocess.STDOUT,
"stdin": stdin if stdin else subprocess.DEVNULL,
"bufsize": -1,
"cwd": cwd,
"env": gen_env(global_interpreter, lang, extra_paths=extra_paths),
"shell": self.shell
}

if stdin:
args['stdin'] = stdin

return subprocess.Popen(args=[' '.join(cmd)] if self.shell else cmd, **args)


Expand Down
5 changes: 3 additions & 2 deletions bauh/gems/appimage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def install_file(self, root_password: str, watcher: ProcessWatcher) -> bool:

def update_file(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher):
file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(),
allowed_extensions={'AppImage'},
allowed_extensions={'AppImage', '*'},
search_path=get_default_manual_installation_file_dir())
input_version = TextInputComponent(label=self.i18n['version'].capitalize())
file_chooser.observers.append(ManualInstallationFileObserver(None, input_version))
Expand All @@ -162,7 +162,8 @@ def update_file(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher
components=[FormComponent(label='', components=[file_chooser, input_version], spaces=False)],
confirmation_label=self.i18n['proceed'].capitalize(),
deny_label=self.i18n['cancel'].capitalize()):
if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path):

if not file_chooser.file_path or not os.path.isfile(file_chooser.file_path) or not file_chooser.file_path.lower().strip().endswith('.appimage'):
watcher.request_confirmation(title=self.i18n['error'].capitalize(),
body=self.i18n['appimage.custom_action.install_file.invalid_file'],
deny_button=False)
Expand Down
2 changes: 1 addition & 1 deletion bauh/gems/appimage/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_disk_icon_path(self):
def has_screenshots(self):
return not self.installed and self.url_screenshot

def get_display_name(self) -> str:
def get_name_tooltip(self) -> str:
if self.name and self.imported:
return '{} ({})'.format(self.name, self.i18n['imported'])

Expand Down
4 changes: 2 additions & 2 deletions bauh/gems/flatpak/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from bauh.commons.html import strip_html, bold
from bauh.commons.system import ProcessHandler
from bauh.gems.flatpak import flatpak, SUGGESTIONS_FILE, CONFIG_FILE, UPDATES_IGNORED_FILE, CONFIG_DIR, EXPORTS_PATH, \
get_icon_path, VERSION_1_5, VERSION_1_4
get_icon_path, VERSION_1_5, VERSION_1_2
from bauh.gems.flatpak.config import FlatpakConfigManager
from bauh.gems.flatpak.constants import FLATHUB_API_URL
from bauh.gems.flatpak.model import FlatpakApplication
Expand Down Expand Up @@ -143,7 +143,7 @@ def read_installed(self, disk_loader: Optional[DiskCacheLoader], limit: int = -1
models.append(model)

if update_map and (update_map['full'] or update_map['partial']):
if version >= VERSION_1_4:
if version >= VERSION_1_2:
update_id = '{}/{}/{}'.format(app_json['id'], app_json['branch'], app_json['installation'])

if update_map['full'] and update_id in update_map['full']:
Expand Down
2 changes: 1 addition & 1 deletion bauh/gems/flatpak/flatpak.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_commit(app_id: str, branch: str, installation: str) -> Optional[str]:
def list_installed(version: Version) -> List[dict]:
apps = []

if version < VERSION_1_3:
if version < VERSION_1_2:
app_list = new_subprocess(['flatpak', 'list', '-d'])

for o in app_list.stdout:
Expand Down
8 changes: 7 additions & 1 deletion bauh/view/qt/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,13 @@ def _new_file_chooser(self, c: FileChooserComponent) -> Tuple[QLabel, QLineEdit]

def open_chooser(e):
if c.allowed_extensions:
exts = ';;'.join({'*.{}'.format(e) for e in c.allowed_extensions})
sorted_exts = [e for e in c.allowed_extensions if e != '*']
sorted_exts.sort()

if '*' in c.allowed_extensions:
sorted_exts.append('*')

exts = ';;'.join((f'*.{e}' for e in sorted_exts))
else:
exts = '{} (*);;'.format(self.i18n['all_files'].capitalize())

Expand Down
3 changes: 2 additions & 1 deletion bauh/view/qt/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from bauh.api.abstract.context import ApplicationContext
from bauh.api.abstract.controller import SoftwareManager, SoftwareAction
from bauh.api.abstract.handler import TaskManager
from bauh.commons import user
from bauh.view.qt.components import new_spacer, QCustomToolbar
from bauh.view.qt.qt_utils import centralize
from bauh.view.qt.root import RootDialog
Expand Down Expand Up @@ -55,7 +56,7 @@ def set_password_reply(self, valid: bool, password: str):

def run(self):
root_pwd = None
if self.manager.requires_root(SoftwareAction.PREPARE, None):
if not user.is_root() and self.manager.requires_root(SoftwareAction.PREPARE, None):
ok, root_pwd = self.ask_password()

if not ok:
Expand Down