Skip to content

Commit

Permalink
Merge pull request #2682 from dhalbert/readonly-keyword-arg
Browse files Browse the repository at this point in the history
add readonly= keyword to storage.remount where not already present
  • Loading branch information
dhalbert authored Dec 18, 2023
2 parents 2e698aa + 024d991 commit cb55f61
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CLUE_Light_Painter/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CircuitPython_Essentials/CircuitPython_Logger/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Crickits/flying_trapeze/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Crickits/yanny_or_laurel/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion EInk_Autostereograms/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Introducing_Gemma_M0/Gemma_Logger_boot/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Web_Workflow_Quickstart/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cb55f61

Please sign in to comment.