Skip to content

Commit

Permalink
🚨 Make pre-commit happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed May 24, 2023
1 parent e1a49c5 commit e1e3be5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
15 changes: 4 additions & 11 deletions octoprint_pi_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def _gather_new_camerastack_files():
os.system("/usr/bin/list-usb-cameras > /tmp/camerastack-usb.log")
files["camerastack-usb.log"] = "/tmp/camerastack-usb.log"
except Exception:
logging.getLogger(__name__).exception(
"Failed to create camerastack-usb.log file"
)
logging.getLogger(__name__).exception("Failed to create camerastack-usb.log file")

return files

Expand Down Expand Up @@ -86,9 +84,7 @@ def _gather_new_camerastack_files():

_gather_new_camerastack_files = lambda: { # noqa: F811
"camerastack-journal.log": os.path.join(base, "fake_camerastack_journal.txt"),
"camerastack-libcamera.log": os.path.join(
base, "fake_camerastack_libcamera.txt"
),
"camerastack-libcamera.log": os.path.join(base, "fake_camerastack_libcamera.txt"),
"camerastack-usb.log": os.path.join(base, "fake_camerastack_usb.txt"),
}

Expand Down Expand Up @@ -127,8 +123,7 @@ def from_value(cls, value=0):
"throttled": _FLAG_THROTTLED & value == _FLAG_THROTTLED,
"past_undervoltage": _FLAG_PAST_UNDERVOLTAGE & value
== _FLAG_PAST_UNDERVOLTAGE,
"past_freq_capped": _FLAG_PAST_FREQ_CAPPED & value
== _FLAG_PAST_FREQ_CAPPED,
"past_freq_capped": _FLAG_PAST_FREQ_CAPPED & value == _FLAG_PAST_FREQ_CAPPED,
"past_throttled": _FLAG_PAST_THROTTLED & value == _FLAG_PAST_THROTTLED,
"raw_value": value,
}
Expand Down Expand Up @@ -245,9 +240,7 @@ def get_vcgencmd_throttled_state(command):
output, error = sarge.get_both(command, close_fds=CLOSE_FDS)

if "throttled=0x" not in output:
raise ValueError(
f"Cannot parse {command!r} output: {error if error else output}"
)
raise ValueError(f"Cannot parse {command!r} output: {error if error else output}")

value = output[len("throttled=") :].strip(" \t\r\n\0")
value = int(value, 0)
Expand Down
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ def delete_folder_if_empty(path, applied_handler):
if not self.dry_run:
shutil.rmtree(path)
print(
"removed %s since it was empty"
% path[len(self.source_folder) :]
"removed %s since it was empty" % path[len(self.source_folder) :]
)

def delete_file(path):
Expand Down Expand Up @@ -759,9 +758,7 @@ def read_file_contents(path):
},
)

setup_parameters["long_description"] = read_file_contents(
os.path.join(here, "README.md")
)
setup_parameters["long_description"] = read_file_contents(os.path.join(here, "README.md"))
setup_parameters["long_description_content_type"] = "text/markdown"

setup(**setup_parameters)

0 comments on commit e1e3be5

Please sign in to comment.