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

@@ -177,7 +177,7 @@ class AppImageManager(SoftwareManager, SettingsController):
if os.path.exists(db_path):
try:
return sqlite3.connect(db_path)
except:
except Exception:
self.logger.error(f"Could not connect to database file '{db_path}'")
traceback.print_exc()
else:
@@ -207,13 +207,13 @@ class AppImageManager(SoftwareManager, SettingsController):
not_installed.append(app)
found_map[self._gen_app_key(app)] = {'app': app, 'idx': idx}
idx += 1
except:
except Exception:
self.logger.error("An exception happened while querying the 'apps' database")
traceback.print_exc()
try:
installed = self.read_installed(connection=apps_conn, disk_loader=disk_loader, limit=limit, only_apps=False, pkg_types=None, internet_available=True).installed
except:
except Exception:
installed = None
installed_found = []
@@ -241,7 +241,7 @@ class AppImageManager(SoftwareManager, SettingsController):
installed_found.append(appim)
try:
apps_conn.close()
except:
except Exception:
self.logger.error(f"An exception happened when trying to close the connection to database file '{DATABASE_APPS_FILE}'")
traceback.print_exc()
@@ -288,7 +288,7 @@ class AppImageManager(SoftwareManager, SettingsController):
else:
try:
app.update = parse_version(tup[2]) > parse_version(app.version) if tup[2] else False
except:
except Exception:
app.update = False
traceback.print_exc()
@@ -297,7 +297,7 @@ class AppImageManager(SoftwareManager, SettingsController):
app.url_download_latest_version = tup[3]
break
except:
except Exception:
self.logger.error(f"An exception happened while querying the database file '{DATABASE_APPS_FILE}'")
traceback.print_exc()
finally:
@@ -417,7 +417,7 @@ class AppImageManager(SoftwareManager, SettingsController):
try:
os.remove(pkg.symlink)
self.logger.info(f"symlink '{pkg.symlink}' successfully removed")
except:
except Exception:
msg = f"could not remove symlink '{pkg.symlink}'"
self.logger.error(msg)
@@ -490,7 +490,7 @@ class AppImageManager(SoftwareManager, SettingsController):
if not app_tuple:
self.logger.warning(f"Could not retrieve {pkg} from the database '{DATABASE_APPS_FILE}'")
return res
except:
except Exception:
self.logger.error(f"An exception happened while querying the database file '{DATABASE_APPS_FILE}'")
traceback.print_exc()
app_con.close()
@@ -522,7 +522,7 @@ class AppImageManager(SoftwareManager, SettingsController):
res.pkg_status_idx = idx
return res
except:
except Exception:
self.logger.error(f"An exception happened while querying the database file '{DATABASE_RELEASES_FILE}'")
traceback.print_exc()
finally:
@@ -600,7 +600,7 @@ class AppImageManager(SoftwareManager, SettingsController):
try:
moved, output = handler.handle_simple(SimpleProcess(['mv', pkg.local_file_path, install_file_path]))
except:
except Exception:
output = ''
self.logger.error(f"Could not rename file '{pkg.local_file_path}' as '{install_file_path}'")
moved = False
@@ -649,7 +649,7 @@ class AppImageManager(SoftwareManager, SettingsController):
type_=MessageType.ERROR)
handler.handle(SystemProcess(new_subprocess(['rm', '-rf', out_dir])))
return TransactionResult.fail()
except:
except Exception:
watcher.show_message(title=self.i18n['error'],
body=traceback.format_exc(),
type_=MessageType.ERROR)
@@ -691,7 +691,7 @@ class AppImageManager(SoftwareManager, SettingsController):
try:
shutil.rmtree(extracted_folder)
except:
except Exception:
traceback.print_exc()
SymlinksVerifier.create_symlink(app=pkg, file_path=install_file_path, logger=self.logger,
@@ -814,7 +814,7 @@ class AppImageManager(SoftwareManager, SettingsController):
self.logger.info(f"Mapped {len(res)} AppImage suggestions")
return res
except:
except Exception:
traceback.print_exc()
finally:
connection.close()
@@ -849,7 +849,7 @@ class AppImageManager(SoftwareManager, SettingsController):
if logs:
print(f'{Fore.YELLOW}[bauh][appimage] {f} deleted{Fore.RESET}')
except:
except Exception:
if logs:
print(f'{Fore.RED}[bauh][appimage] An exception has happened when deleting {f}{Fore.RESET}')
traceback.print_exc()
@@ -884,7 +884,7 @@ class AppImageManager(SoftwareManager, SettingsController):
try:
self.configman.save_config(config_)
return True, None
except:
except Exception:
return False, [traceback.format_exc()]
def gen_custom_actions(self) -> Generator[CustomSoftwareAction, None, None]: