fix "make lint" when run with the new pycodestyle/flake8

This commit is contained in:
Michael Hudson-Doyle 2023-03-23 16:38:35 +13:00
parent fb3361918e
commit c0438b44ca
5 changed files with 7 additions and 7 deletions

View File

@ -54,8 +54,8 @@ class RecoveryChooser(TuiApplication):
]
def __init__(self, opts, chooser_input, chooser_output):
"""Takes the options and raw input/output streams for communicating with the
chooser parent process.
"""Takes the options and raw input/output streams for communicating
with the chooser parent process.
"""
self._chooser_output = chooser_output
# make_model is used by super()'s constructor, but we need to use the

View File

@ -58,8 +58,8 @@ class ChooserBaseView(BaseView):
def by_preferred_action_type(action):
"""Order action entries by having the 'run' mode first, then 'recover', then
'install', the rest is ordered alphabetically."""
"""Order action entries by having the 'run' mode first, then 'recover',
then 'install', the rest is ordered alphabetically."""
priority = {"run": 0, "recover": 1, "install": 2}
return (priority.get(action.mode, 100), action.title.lower())

View File

@ -79,7 +79,7 @@ class LoggedCommandRunner:
-> subprocess.CompletedProcess:
stdout, stderr = await proc.communicate()
# .communicate() forces returncode to be set to a value
assert(proc.returncode is not None)
assert proc.returncode is not None
if proc.returncode != 0:
raise subprocess.CalledProcessError(proc.returncode, proc.args)
else:

View File

@ -103,7 +103,7 @@ def exc_message(exc):
message = result.get("result", {}).get("message")
if message is not None:
return message
return"Unknown error: {}".format(exc)
return "Unknown error: {}".format(exc)
class RefreshView(BaseView):

View File

@ -102,7 +102,7 @@ async def arun_command(cmd: Sequence[str], *,
stderr = stderr.decode(encoding)
log.debug("arun_command %s exited with code %s", cmd, proc.returncode)
# .communicate() forces returncode to be set to a value
assert(proc.returncode is not None)
assert proc.returncode is not None
if check and proc.returncode != 0:
raise subprocess.CalledProcessError(proc.returncode, cmd,
stdout, stderr)