Skip to content

Commit

Permalink
samples: format sample script
Browse files Browse the repository at this point in the history
By ruff formatter.

Signed-off-by: Takashi Sakamoto <[email protected]>
  • Loading branch information
takaswie committed Sep 25, 2024
1 parent 625af3a commit 25eba6a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions samples/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@


def print_help_with_msg(cmd: str, msg: str):
print('Error:', file=stderr)
print(' {}'.format(msg), file=stderr)
print('', file=stderr)
print('Usage:', file=stderr)
print(' {} PATH'.format(cmd), file=stderr)
print('', file=stderr)
print(' where', file=stderr)
print(' PATH: path to special file for Linux FireWire character device (/dev/fw[0-9]+)',
file=stderr)
print("Error:", file=stderr)
print(" {}".format(msg), file=stderr)
print("", file=stderr)
print("Usage:", file=stderr)
print(" {} PATH".format(cmd), file=stderr)
print("", file=stderr)
print(" where", file=stderr)
print(
" PATH: path to special file for Linux FireWire character device (/dev/fw[0-9]+)",
file=stderr,
)


def detect_fw_cdev(literal: str) -> Path:
Expand All @@ -26,8 +28,10 @@ def detect_fw_cdev(literal: str) -> Path:
msg = '"{}" is not for special file of any character device'.format(path)
raise ValueError(msg)

if path.name.find('fw') != 0:
msg = '"{}" is not for special file of Linux Firewire character device'.format(path)
if path.name.find("fw") != 0:
msg = '"{}" is not for special file of Linux Firewire character device'.format(
path
)
raise ValueError(msg)

return path
Expand Down

0 comments on commit 25eba6a

Please sign in to comment.