From df070ebd72db8e0b694d8c340b1d7d1a91841406 Mon Sep 17 00:00:00 2001 From: n07070 Date: Fri, 13 Nov 2026 02:46:05 +0100 Subject: [PATCH] Apply formatting --- src/raspberry.py | 24 ++++++++++++------------ src/web.py | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/raspberry.py b/src/raspberry.py index fa8553c..8678e6c 100644 --- a/src/raspberry.py +++ b/src/raspberry.py @@ -27,12 +27,7 @@ class Raspberry: # dede """ - def __init__( - self, - print_queue, - app, - configuration_file - ): + def __init__(self, print_queue, app, configuration_file): self.print_queue = print_queue self.app = app self.configuration_file = configuration_file @@ -68,7 +63,9 @@ class Raspberry: self.app.logger.warning( "Couldn't get sufficient hardware information from /proc/cpuinfo" ) - self.app.logger.warning("Unable to determine if we are on a Raspberry Pi.") + self.app.logger.warning( + "Unable to determine if we are on a Raspberry Pi." + ) return False except IOError: self.app.logger.error("Unable to open `/proc/cpuinfo`.") @@ -95,13 +92,16 @@ class Raspberry: self.indicator_countdown(iters=3) self.button = Button( self.configuration_file["rpi"]["button_gpio_port_number"], - pull_up=True, bounce_time=0.1 + pull_up=True, + bounce_time=0.1, ) self.button.when_pressed = self.on_button_pressed self.app.logger.debug("Activated button") # The "flash" is a relay-controlled device ( light bulb for example ) - self.flash = DigitalOutputDevice(self.configuration_file["rpi"]["flash_gpio_port_number"]) + self.flash = DigitalOutputDevice( + self.configuration_file["rpi"]["flash_gpio_port_number"] + ) self.flash_toggle() self.app.logger.debug("Activated flash") @@ -215,9 +215,9 @@ class Raspberry: y = image.height - logo.height - margin else: raise ValueError( - "Invalid position." + - "Choose from 'bottom_right', 'top_left', " + - " 'top_right', or 'bottom_left'." + "Invalid position." + + "Choose from 'bottom_right', 'top_left', " + + " 'top_right', or 'bottom_left'." ) # Composite the logo onto the image diff --git a/src/web.py b/src/web.py index 173ae06..fb23d30 100644 --- a/src/web.py +++ b/src/web.py @@ -105,7 +105,9 @@ class Web: image.save(os.path.join(self.app.config["UPLOAD_FOLDER"], filename)) except OSError as e: self.app.logger.error("Could not save file %s", e) - raise RuntimeError("An OS error occured while uploading this file : " + str(e)) from e + raise RuntimeError( + "An OS error occured while uploading this file : " + str(e) + ) from e self.app.logger.debug( "File saved to " @@ -113,9 +115,7 @@ class Web: ) return True - self.app.logger.error( - "Could not save file because the filename is forbidden" - ) + self.app.logger.error("Could not save file because the filename is forbidden") raise RuntimeError("This file type is forbidden.") def get_queue_state(self):