withdialogs.WaitingMessage(title="Mass Storage Enabled",text="You can now use the badge like a USB key.\nPlease safely eject afterwards. This app will close automatically."):
print("Waiting for USB mass storage to be unmounted...")
tilda.storage_disable_usb()
user_agreed=dialogs.prompt_boolean("Note: enabling mass storage is slightly risky, as the badge may end up factory "
"resetting even if you safely eject it. Do you want to continue?")
ifuser_agreed:
print("enabling USB storage...")
tilda.storage_enable_usb()
time.sleep(1)
print("DONE")
withdialogs.WaitingMessage(title="Mass Storage Enabled",text="You can now use the badge like a USB key.\nPlease safely eject afterwards. This app will close automatically."):
print("Waiting for USB mass storage to be unmounted...")