Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jun 26, 2024
1 parent e30e66b commit 1bd0a14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spalloc_client/protocol_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def get_board_at_position(self, machine_name, x, y, z,
frozenset("machine chip_x chip_y".split()),
frozenset("job_id chip_x chip_y".split())])

def where_is(self, timeout :Optional[int] = None,
def where_is(self, timeout: Optional[int] = None,
**kwargs: Dict[str, object]):
# Test for whether sane arguments are passed.
keywords = frozenset(kwargs)
Expand Down
9 changes: 5 additions & 4 deletions spalloc_client/scripts/alloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def print_info(machine_name: str, connections: Dict[Tuple[int, int], str],
def run_command(
command: List[str], job_id: int, machine_name: str,
connections: Dict[Tuple[int, int], str], width: int, height: int,
ip_file_filename: str):
ip_file_filename: str):
""" Run a user-specified command, substituting arguments for values taken
from the allocated board.
Expand Down Expand Up @@ -253,15 +253,15 @@ def run_command(
p.terminate()


def info(msg:str):
def info(msg: str):
"""
Writes a message to the terminal
"""
if not arguments.quiet:
t.stream.write(f"{msg}\n")


def update(msg:str, colour: functools.partial, *args: List[object]):
def update(msg: str, colour: functools.partial, *args: List[object]):
"""
Writes a message to the terminal in the schoosen colour.
"""
Expand Down Expand Up @@ -426,7 +426,8 @@ def parse_argv(argv: List[str]) -> Tuple[
return parser, parser.parse_args(argv)


def run_job(job_args: List[str], job_kwargs: Dict[str, str], ip_file_filename: str):
def run_job(job_args: List[str], job_kwargs: Dict[str, str],
ip_file_filename: str):
"""
Run a job
"""
Expand Down
3 changes: 2 additions & 1 deletion spalloc_client/scripts/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
from spalloc_client._utils import render_timestamp
from .support import Terminate, Script


def _state_name(mapping):
return JobState(mapping["state"]).name # pylint: disable=no-member

Expand Down Expand Up @@ -362,7 +363,7 @@ def verify_arguments(self, args):
if args.job_id is None and args.owner is None:
self.parser.error("job ID (or --owner) not specified")

def body(self, client:ProtocolClient, args: argparse.Namespace):
def body(self, client: ProtocolClient, args: argparse.Namespace):
jid = self.get_job_id(client, args)

# Do as the user asked
Expand Down

0 comments on commit 1bd0a14

Please sign in to comment.