Skip to content

Commit

Permalink
Fixed flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Torxed committed Nov 8, 2024
1 parent 2a4ffd4 commit c1111b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions archinstall/lib/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ class DownloadTimeout(Exception):
Download timeout exception raised by DownloadTimer.
'''


class PacmanIssue(Exception):
pass
14 changes: 7 additions & 7 deletions archinstall/lib/pacman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def __init__(
self.synced = synced
self.rootdir = rootdir

self._temporary_pacman_root :pathlib.Path | None = None
self._temporary_pacman_root: pathlib.Path | None = None
self._session = None
self._source_config_mirrors = True if servers is None or include_config_mirrors is True else False

Expand Down Expand Up @@ -186,7 +186,7 @@ def load_config(self) -> typing.Dict[str, Any]:

print(f"Loading pacman configuration {self.config}")

config :typing.Dict[str, typing.Any] = {}
config: typing.Dict[str, typing.Any] = {}
with self.config.open('r') as fh:
_section = None
for line in fh:
Expand All @@ -200,7 +200,7 @@ def load_config(self) -> typing.Dict[str, Any]:
config_item = line.strip()

if _section and _section not in config:
config[_section] = {}
config[_section] = {}

if _section and _section.lower() == 'options':
if '=' in config_item:
Expand Down Expand Up @@ -348,8 +348,8 @@ def install(self, *packages: str):
[_transaction.add_pkg(pkg) for pkg in pyalpm_package_list]

def search(self, *patterns: str, exact: bool = True):
results :typing.List[pyalpm.Package] = []
queries :typing.List[str] = []
results: typing.List[pyalpm.Package] = []
queries: typing.List[str] = []

if not self._session:
raise PacmanIssue("Pacman() needs to be executed in a context")
Expand Down Expand Up @@ -382,8 +382,8 @@ def search(self, *patterns: str, exact: bool = True):
return results

def query(self, *patterns: str, exact: bool = True):
results :typing.List[pyalpm.Package] = []
queries :typing.List[str] = []
results: typing.List[pyalpm.Package] = []
queries: typing.List[str] = []

if not self._session:
raise PacmanIssue("Pacman() needs to be executed in a context")
Expand Down

0 comments on commit c1111b1

Please sign in to comment.