Merge branch 'master' into staging

# Conflicts:
#	bauh/gems/appimage/controller.py
#	bauh/gems/arch/updates.py
This commit is contained in:
Vinicius Moreira
2022-12-12 07:53:51 -03:00
66 changed files with 249 additions and 245 deletions

View File

@@ -99,9 +99,9 @@ class PackagesTable(QTableWidget):
def has_any_settings(self, pkg: PackageView):
return pkg.model.has_history() or \
pkg.model.can_be_downgraded() or \
pkg.model.supports_ignored_updates() or \
bool(pkg.model.get_custom_actions())
pkg.model.can_be_downgraded() or \
pkg.model.supports_ignored_updates() or \
bool(pkg.model.get_custom_actions())
def show_pkg_actions(self, pkg: PackageView):
menu_row = QMenu()
@@ -123,11 +123,10 @@ class PackagesTable(QTableWidget):
if pkg.model.can_be_downgraded():
def downgrade():
if ConfirmationDialog(title=self.i18n['manage_window.apps_table.row.actions.downgrade'],
body=self._parag(self.i18n[
'manage_window.apps_table.row.actions.downgrade.popup.body'].format(
self._bold(str(pkg)))),
i18n=self.i18n).ask():
if ConfirmationDialog(
title=self.i18n['manage_window.apps_table.row.actions.downgrade'],
body=self._parag(self.i18n['manage_window.apps_table.row.actions.downgrade.popup.body'].format(self._bold(str(pkg)))),
i18n=self.i18n).ask():
self.window.begin_downgrade(pkg)
menu_row.addAction(QCustomMenuAction(parent=menu_row,
@@ -414,7 +413,7 @@ class PackagesTable(QTableWidget):
elif pkg.model.icon_url:
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': None})
except:
except Exception:
icon = QIcon(pkg.model.get_default_icon_path())
elif not pkg.model.icon_url:

View File

@@ -216,7 +216,7 @@ class QtComponentsManager:
if state['r'] != self._is_read_only(comp):
self._set_read_only(comp, state['r'])
def restore_group_state(self, group_id: int, state_id: int):
def restore_group_state(self, group_id: int, state_id: int):
states = self._saved_states.get(state_id)
if states:
@@ -808,7 +808,7 @@ class FormQt(QGroupBox):
label, field = self._new_file_chooser(c)
self.layout().addRow(label, field)
elif isinstance(c, FormComponent):
label, field = None, FormQt(c, self.i18n)
label, field = None, FormQt(c, self.i18n)
self.layout().addRow(field)
elif isinstance(c, TwoStateButtonComponent):
label, field = self._new_label(c), TwoStateButtonQt(c)
@@ -1037,7 +1037,7 @@ class TabGroupQt(QTabWidget):
for c in model.tabs:
try:
icon = QIcon(c.icon_path) if c.icon_path else QIcon()
except:
except Exception:
traceback.print_exc()
icon = QIcon()

View File

@@ -45,7 +45,7 @@ class HistoryDialog(QDialog):
if current_status:
item.setCursor(QCursor(Qt.WhatsThisCursor))
item.setProperty('outdated', str(row != 0).lower())
item.setProperty('outdated', str(row != 0).lower())
tip = '{}. {}.'.format(i18n['popup.history.selected.tooltip'], i18n['version.{}'.format('updated'if row == 0 else 'outdated')].capitalize())

View File

@@ -29,7 +29,7 @@ class ValidatePassword(QThread):
if isinstance(self.password, str):
try:
valid = validate_password(self.password)
except:
except Exception:
traceback.print_exc()
valid = False

View File

@@ -46,7 +46,7 @@ def get_cli_path() -> str:
return cli_path
else:
return shutil.which(CLI_NAME)
def list_updates(logger: logging.Logger) -> List[PackageUpdate]:
cli_path = get_cli_path()
@@ -94,7 +94,7 @@ class UpdateCheck(QThread):
self._notify_updates()
try:
os.remove(TRAY_CHECK_FILE)
except:
except Exception:
traceback.print_exc()
else:
self.sleep(self.check_interval)

View File

@@ -48,7 +48,7 @@ class AsyncAction(QThread, ProcessWatcher):
signal_root_password = pyqtSignal()
signal_progress_control = pyqtSignal(bool)
def __init__(self, i18n: I18n, root_password: Optional[Tuple[bool, str]] = None):
def __init__(self, i18n: I18n, root_password: Optional[Tuple[bool, str]] = None):
super(AsyncAction, self).__init__()
self.i18n = i18n
self.wait_confirmation = False
@@ -135,7 +135,7 @@ class AsyncAction(QThread, ProcessWatcher):
def _generate_backup(self, app_config: dict, root_password: Optional[str]) -> bool:
if app_config['backup']['mode'] not in ('only_one', 'incremental'):
self.show_message(title=self.i18n['error'].capitalize(),
body='{}: {}'.format(self.i18n['action.backup.invalid_mode'],bold(app_config['backup']['mode'])),
body='{}: {}'.format(self.i18n['action.backup.invalid_mode'], bold(app_config['backup']['mode'])),
type_=MessageType.ERROR)
self.change_substatus('')
return False
@@ -414,7 +414,7 @@ class UpgradeSelected(AsyncAction):
with open(self.SUMMARY_FILE.format(upgrade_id), 'w+') as f:
f.write(summary_text.read())
except:
except Exception:
traceback.print_exc()
def _handle_internet_off(self):
@@ -592,7 +592,7 @@ class RefreshApps(AsyncAction):
refreshed_types = self.pkg_types
self.notify_finished({'installed': res.installed, 'total': res.total, 'types': refreshed_types})
except:
except Exception:
traceback.print_exc()
self.notify_finished({'installed': [], 'total': 0, 'types': set()})
finally:
@@ -631,7 +631,7 @@ class UninstallPackage(AsyncAction):
self.manager.clean_cache_for(p)
self.notify_finished({'success': res.success, 'removed': res.removed, 'pkg': self.pkg})
except:
except Exception:
traceback.print_exc()
self.notify_finished({'success': False, 'removed': None, 'pkg': self.pkg})
finally:
@@ -948,7 +948,7 @@ class LaunchPackage(AsyncAction):
super(LaunchPackage, self).msleep(250)
self.manager.launch(self.pkg.model)
self.notify_finished(True)
except:
except Exception:
traceback.print_exc()
finally:
self.notify_finished(False)
@@ -1083,7 +1083,7 @@ class SaveTheme(QThread):
try:
configman.save_config(core_config)
except:
except Exception:
traceback.print_exc()

View File

@@ -1601,7 +1601,7 @@ class ManageWindow(QWidget):
icon = QIcon(action.icon_path)
else:
icon = QIcon.fromTheme(action.icon_path)
except:
except Exception:
icon = None
else:
icon = None