mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
flake warnings (#304)
This commit is contained in:
@@ -201,7 +201,7 @@ class Aptitude:
|
||||
query = f"'({'|'.join(f'?exact-name({n})' for n in names)})'"
|
||||
yield from self.search(query=query, fill_size=fill_size)
|
||||
|
||||
def remove(self, packages: Iterable[str], root_password: Optional[str], purge: bool = False) -> SimpleProcess:
|
||||
def remove(self, packages: Iterable[str], root_password: Optional[str], purge: bool = False) -> SimpleProcess:
|
||||
return SimpleProcess(cmd=self.gen_remove_cmd(packages, purge).split(' '), shell=True,
|
||||
root_password=root_password, extra_env=self.vars_fixes, preserve_env=self._preserve_env)
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ class DebianConfigManager(YAMLConfigManager):
|
||||
|
||||
def get_default_config(self) -> dict:
|
||||
return {
|
||||
'suggestions.exp': 24, # hours
|
||||
'index_apps.exp': 1440, # 24 hours
|
||||
'sync_pkgs.time': 1440, # 24 hours
|
||||
'pkg_sources.app': None,
|
||||
'remove.purge': False
|
||||
}
|
||||
'suggestions.exp': 24, # hours
|
||||
'index_apps.exp': 1440, # 24 hours
|
||||
'sync_pkgs.time': 1440, # 24 hours
|
||||
'pkg_sources.app': None,
|
||||
'remove.purge': False
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class DebianPackageManager(SoftwareManager, SettingsController):
|
||||
for pkg in self.aptitude.search(words):
|
||||
if fill_config.is_alive():
|
||||
fill_config.join()
|
||||
|
||||
|
||||
pkg.global_purge = bool(config_.get('remove.purge', False))
|
||||
if pkg.installed:
|
||||
pkg.bind_app(self.apps_index.get(pkg.name))
|
||||
@@ -688,7 +688,7 @@ class DebianPackageManager(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]:
|
||||
|
||||
@@ -53,7 +53,7 @@ class ApplicationIndexer:
|
||||
|
||||
try:
|
||||
timestamp = datetime.fromtimestamp(float(timestamp_str))
|
||||
except:
|
||||
except Exception:
|
||||
self._log.error(f'Could not parse the Debian applications index timestamp: {timestamp_str} '
|
||||
f'({self._file_timestamp_path})')
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -96,7 +96,7 @@ class DebianSuggestionsDownloader(Thread):
|
||||
|
||||
try:
|
||||
suggestions_timestamp = datetime.fromtimestamp(float(timestamp_str))
|
||||
except:
|
||||
except Exception:
|
||||
self._log.error(f'Could not parse the Debian cached suggestions timestamp: {timestamp_str}')
|
||||
traceback.print_exc()
|
||||
return True
|
||||
@@ -128,14 +128,14 @@ class DebianSuggestionsDownloader(Thread):
|
||||
try:
|
||||
with open(self.file_suggestions(), 'w+') as f:
|
||||
f.write(text)
|
||||
except:
|
||||
except Exception:
|
||||
self._log.error(f"An exception happened while writing the file '{self.file_suggestions()}'")
|
||||
traceback.print_exc()
|
||||
|
||||
try:
|
||||
with open(self.file_suggestions_timestamp(), 'w+') as f:
|
||||
f.write(str(timestamp))
|
||||
except:
|
||||
except Exception:
|
||||
self._log.error(f"An exception happened while writing the file '{self.file_suggestions_timestamp()}'")
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class UpdateApplicationIndex(Thread):
|
||||
|
||||
try:
|
||||
self._indexer.update_index(self._mapping_apps.apps)
|
||||
except:
|
||||
except Exception:
|
||||
finish_msg = self._i18n['error']
|
||||
|
||||
self._taskman.update_progress(self._id, 100, finish_msg)
|
||||
@@ -150,7 +150,7 @@ class SynchronizePackages(Thread):
|
||||
|
||||
try:
|
||||
last_timestamp = datetime.fromtimestamp(float(timestamp_str))
|
||||
except:
|
||||
except Exception:
|
||||
logger.error(f'Could not parse the packages synchronization timestamp: {timestamp_str} '
|
||||
f'({PACKAGE_SYNC_TIMESTAMP_FILE})')
|
||||
traceback.print_exc()
|
||||
@@ -169,7 +169,7 @@ class SynchronizePackages(Thread):
|
||||
ti = time.time()
|
||||
self._log.info("Begin: packages synchronization")
|
||||
self._taskman.update_progress(self._id, 1, None)
|
||||
|
||||
|
||||
handler = ProcessHandler(self._watcher)
|
||||
updated, _ = handler.handle_simple(self._aptitude.update(self._root_password),
|
||||
output_handler=self._notify_output)
|
||||
|
||||
Reference in New Issue
Block a user