From 024d991a243ad0c88eebddb1b321642c0db9e668 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 3 Dec 2023 17:44:19 -0500 Subject: [PATCH] add readonly= keyword to storage.remount where not already present --- CLUE_Light_Painter/boot.py | 4 ++-- CircuitPython_Essentials/CircuitPython_Logger/boot.py | 2 +- Crickits/flying_trapeze/boot.py | 2 +- Crickits/yanny_or_laurel/boot.py | 2 +- EInk_Autostereograms/boot.py | 2 +- Introducing_Gemma_M0/Gemma_Logger_boot/code.py | 2 +- Web_Workflow_Quickstart/env.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CLUE_Light_Painter/boot.py b/CLUE_Light_Painter/boot.py index 66363f782..6d7407bfc 100755 --- a/CLUE_Light_Painter/boot.py +++ b/CLUE_Light_Painter/boot.py @@ -21,5 +21,5 @@ IO.direction = digitalio.Direction.INPUT IO.pull = digitalio.Pull.UP -if IO.value: # No connection - storage.remount('/', False) # Remount storage as read/write for painter +if IO.value: # No connection + storage.remount('/', readonly=False) # Remount storage as read/write for painter diff --git a/CircuitPython_Essentials/CircuitPython_Logger/boot.py b/CircuitPython_Essentials/CircuitPython_Logger/boot.py index e5c4246f5..bb26a556c 100644 --- a/CircuitPython_Essentials/CircuitPython_Logger/boot.py +++ b/CircuitPython_Essentials/CircuitPython_Logger/boot.py @@ -20,4 +20,4 @@ switch.pull = digitalio.Pull.UP # If the switch pin is connected to ground CircuitPython can write to the drive -storage.remount("/", switch.value) +storage.remount("/", readonly=switch.value) diff --git a/Crickits/flying_trapeze/boot.py b/Crickits/flying_trapeze/boot.py index 03609ff3b..a2dcfd0be 100644 --- a/Crickits/flying_trapeze/boot.py +++ b/Crickits/flying_trapeze/boot.py @@ -13,4 +13,4 @@ switch.pull = digitalio.Pull.UP # If the switch pin is connected to ground CircuitPython can write to the drive -storage.remount("/", switch.value) +storage.remount("/", readonly=switch.value) diff --git a/Crickits/yanny_or_laurel/boot.py b/Crickits/yanny_or_laurel/boot.py index 4c7e5370e..131a158de 100644 --- a/Crickits/yanny_or_laurel/boot.py +++ b/Crickits/yanny_or_laurel/boot.py @@ -11,4 +11,4 @@ switch.pull = digitalio.Pull.UP # If the switch pin is connected to ground CircuitPython can write to the drive -storage.remount("/", switch.value) +storage.remount("/", readonly=switch.value) diff --git a/EInk_Autostereograms/boot.py b/EInk_Autostereograms/boot.py index a3413aa06..3823f7169 100644 --- a/EInk_Autostereograms/boot.py +++ b/EInk_Autostereograms/boot.py @@ -28,4 +28,4 @@ def read_buttons(): print("OS has write access to CircuitPython drive") else: print("CircuitPython has write access to drive") -storage.remount("/", readonly) +storage.remount("/", readonly=readonly) diff --git a/Introducing_Gemma_M0/Gemma_Logger_boot/code.py b/Introducing_Gemma_M0/Gemma_Logger_boot/code.py index f21a6e571..80ffde536 100644 --- a/Introducing_Gemma_M0/Gemma_Logger_boot/code.py +++ b/Introducing_Gemma_M0/Gemma_Logger_boot/code.py @@ -12,4 +12,4 @@ # If the D0 is connected to ground with a wire # CircuitPython can write to the drive -storage.remount("/", switch.value) +storage.remount("/", readonly=switch.value) diff --git a/Web_Workflow_Quickstart/env.py b/Web_Workflow_Quickstart/env.py index 3e5396398..ca2fb5463 100755 --- a/Web_Workflow_Quickstart/env.py +++ b/Web_Workflow_Quickstart/env.py @@ -45,7 +45,7 @@ def get_current_toml_file(enumerated_files): # Erase settings.toml then write the contents of the new settings.toml file def change_toml_file(toml_file): try: - storage.remount("/", False) + storage.remount("/", readonly=False) with open("settings.toml", "w") as settings: settings.write("") with open("settings.toml", "w") as settings, open(toml_file) as f: