From 4e1bffa72f24ad8f470016f82df661efc18c7027 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 25 Mar 2022 15:56:47 -0300 Subject: [PATCH] [snap] improvement: allowing the actions output locale to be decided by the Snap client --- CHANGELOG.md | 3 +++ bauh/gems/snap/snap.py | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a1d313..da2c6d8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - General - code refactoring +- Snap + - allowing the actions output locale to be decided by the Snap client + ### Fixes - Arch - regression: not displaying ignored updates diff --git a/bauh/gems/snap/snap.py b/bauh/gems/snap/snap.py index 2e2eb5b7..f3d4f2ed 100644 --- a/bauh/gems/snap/snap.py +++ b/bauh/gems/snap/snap.py @@ -14,6 +14,7 @@ def is_installed() -> bool: def uninstall_and_stream(app_name: str, root_password: Optional[str]) -> SimpleProcess: return SimpleProcess(cmd=('snap', 'remove', app_name), root_password=root_password, + lang=None, shell=True) @@ -27,13 +28,14 @@ def install_and_stream(app_name: str, confinement: str, root_password: Optional[ if channel: install_cmd.append(f'--channel={channel}') - return SimpleProcess(install_cmd, root_password=root_password, shell=True) + return SimpleProcess(install_cmd, root_password=root_password, shell=True, lang=None) def downgrade_and_stream(app_name: str, root_password: Optional[str]) -> SimpleProcess: return SimpleProcess(cmd=('snap', 'revert', app_name), root_password=root_password, - shell=True) + shell=True, + lang=None) def refresh_and_stream(app_name: str, root_password: Optional[str], channel: Optional[str] = None) -> SimpleProcess: @@ -44,7 +46,7 @@ def refresh_and_stream(app_name: str, root_password: Optional[str], channel: Opt return SimpleProcess(cmd=cmd, root_password=root_password, - error_phrases={'no updates available'}, + lang=None, shell=True) @@ -54,7 +56,7 @@ def run(cmd: str): def is_api_available() -> Tuple[bool, str]: output = StringIO() - for o in SimpleProcess(('snap', 'search')).instance.stdout: + for o in SimpleProcess(('snap', 'search'), lang=None).instance.stdout: if o: output.write(o.decode())