flake warnings (#304)

This commit is contained in:
Bruno Cabral
2022-12-12 02:44:27 -08:00
committed by GitHub
parent f10a3f1d1a
commit fb4109bd77
67 changed files with 252 additions and 248 deletions

View File

@@ -1 +0,0 @@

View File

@@ -107,7 +107,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
try:
Popen(['timeshift-launcher'], stderr=STDOUT)
return True
except:
except Exception:
traceback.print_exc()
watcher.show_message(title=self.i18n["error"].capitalize(),
body=self.i18n['action.backups.tool_error'].format(bold('Timeshift')),
@@ -266,7 +266,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
self.logger.info(f'Took {tf - ti:.2f} seconds')
return res
def _add_category(self, pkg: SoftwarePackage, category: str):
def _add_category(self, pkg: SoftwarePackage, category: str):
if isinstance(pkg.categories, tuple):
pkg.categories = tuple((*pkg.categories, category))
elif isinstance(pkg.categories, list):
@@ -331,7 +331,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
disk_loader.join()
self._update_post_transaction_status(res)
return res
except:
except Exception:
traceback.print_exc()
return TransactionResult(success=False, installed=[], removed=[])
finally:
@@ -352,7 +352,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
disk_loader.join()
self._update_post_transaction_status(res)
return res
except:
except Exception:
traceback.print_exc()
return TransactionResult(success=False, installed=[], removed=[])
finally:
@@ -617,7 +617,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
try:
clean_app_files(managers=self.managers, logs=False)
restart_app()
except:
except Exception:
return False
return True

View File

@@ -114,7 +114,7 @@ class AdaptableFileDownloader(FileDownloader):
if size:
base_substatus.write(f' ( {size} )')
watcher.change_substatus(base_substatus.getvalue())
except:
except Exception:
pass
def _get_appropriate_threads_number(self, max_threads: int, known_size: int) -> int:
@@ -193,7 +193,7 @@ class AdaptableFileDownloader(FileDownloader):
watcher.change_substatus(msg.getvalue())
success, _ = handler.handle_simple(process)
except:
except Exception:
traceback.print_exc()
self._rm_bad_file(file_name, output_path, final_cwd, handler, root_password)

View File

@@ -587,16 +587,17 @@ class GenericSettingsManager(SettingsController):
opts=ops_opts,
id_='downgrade')
mode = new_select(label=self.i18n['core.config.backup.mode'],
tip=None,
value=core_config['backup']['mode'],
opts=[
(self.i18n['core.config.backup.mode.incremental'], 'incremental',
self.i18n['core.config.backup.mode.incremental.tip']),
(self.i18n['core.config.backup.mode.only_one'], 'only_one',
self.i18n['core.config.backup.mode.only_one.tip'])
],
id_='mode')
mode = new_select(
label=self.i18n['core.config.backup.mode'],
tip=None,
value=core_config['backup']['mode'],
opts=[
(self.i18n['core.config.backup.mode.incremental'], 'incremental',
self.i18n['core.config.backup.mode.incremental.tip']),
(self.i18n['core.config.backup.mode.only_one'], 'only_one',
self.i18n['core.config.backup.mode.only_one.tip'])
],
id_='mode')
type_ = new_select(label=self.i18n['type'].capitalize(),
tip=None,
value=core_config['backup']['type'],

View File

@@ -42,7 +42,7 @@ def check_for_update(logger: logging.Logger, http_client: HttpClient, i18n: I18n
Path(notifications_dir).mkdir(parents=True, exist_ok=True)
with open(release_file, 'w+') as f:
f.write('')
except:
except Exception:
logger.error("An error occurred while trying to create the update notification file: {}".format(release_file))
if tray:
@@ -55,5 +55,5 @@ def check_for_update(logger: logging.Logger, http_client: HttpClient, i18n: I18n
logger.warning("No official release found")
else:
logger.warning("No releases returned from the GitHub API")
except:
except Exception:
logger.error("An error occurred while trying to retrieve the current releases")