diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cde828d4a..ccad3a048 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: check-merge-conflict - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.2 + rev: v0.16.3 hooks: - id: ruff-check args: diff --git a/examples/async.py b/examples/async.py index 0caef3a4f..30f3ce625 100755 --- a/examples/async.py +++ b/examples/async.py @@ -90,7 +90,7 @@ async def run(worker) -> None: # Just a busy waiting for event # We need to keep communication with phone to get notifications print("Press Ctrl+C to interrupt") - while 1: + while True: try: signal = await worker.get_signal_quality_async() print(f"Signal is at {signal['SignalPercent']:d}%") diff --git a/examples/filesystem_test.py b/examples/filesystem_test.py index 226c25db8..b65126c1b 100755 --- a/examples/filesystem_test.py +++ b/examples/filesystem_test.py @@ -55,7 +55,7 @@ def print_root_folders(state_machine) -> None: file_obj = state_machine.GetNextRootFolder("") - while 1: + while True: print(f"{file_obj['ID_FullName']} - {file_obj['Name']}") try: file_obj = state_machine.GetNextRootFolder(file_obj["ID_FullName"]) @@ -181,7 +181,7 @@ def main() -> None: # ruff: ignore[too-many-branches, too-many-statements, comp # Check GetNextFileFolder print("\n\nExpectation: Info for a file of the phone (cgi.jpg)") file_f = state_machine.GetNextFileFolder(1) - while 1: + while True: if file_f["Name"] != "cgi.jpg": file_f = state_machine.GetNextFileFolder(0) else: @@ -216,7 +216,7 @@ def main() -> None: # ruff: ignore[too-many-branches, too-many-statements, comp # Check GetFolderListing print("\n\nExpectation: Listing of cgi.jpg's properties") file_f = state_machine.GetFolderListing(args.folder, 1) - while 1: + while True: if file_f["Name"] != "cgi.jpg": file_f = state_machine.GetFolderListing(args.folder, 0) else: @@ -255,7 +255,7 @@ def main() -> None: # ruff: ignore[too-many-branches, too-many-statements, comp # Check GetFolderListing again *wired* print("\n\nExpectation: Print properties of newly created folder") file_f = state_machine.GetFolderListing(args.folder, 1) - while 1: + while True: if file_f["Name"] != "42alpha": file_f = state_machine.GetFolderListing(args.folder, 0) else: diff --git a/examples/incoming.py b/examples/incoming.py index df5e5ee77..89fa3e7b1 100755 --- a/examples/incoming.py +++ b/examples/incoming.py @@ -75,7 +75,7 @@ def main() -> None: # Just a busy waiting for event # We need to keep communication with phone to get notifications print("Press Ctrl+C to interrupt") - while 1: + while True: signal = state_machine.GetSignalQuality() print(f"Signal is at {signal['SignalPercent']:d}%") time.sleep(1) diff --git a/examples/sms_replier.py b/examples/sms_replier.py index 661a48cb4..0e3cda101 100755 --- a/examples/sms_replier.py +++ b/examples/sms_replier.py @@ -94,7 +94,7 @@ def main() -> None: # We need to keep communication with phone to get notifications print("Press Ctrl+C to interrupt") - while 1: + while True: time.sleep(1) status = state_machine.GetBatteryCharge() print(f"Battery is at {status['BatteryPercent']:d}%")