Merge pull request #180 from beasteers/i2smic-nonint-patch-2

Make i2smic.py noninteractive
This commit is contained in:
Melissa LeBlanc-Williams 2022-11-09 10:36:38 -08:00 committed by GitHub
commit 501435743e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,9 @@ I2S microphone support.
else: else:
shell.bail("Unsupported Pi board detected.") shell.bail("Unsupported Pi board detected.")
auto_load = shell.prompt("Auto load module at boot?") auto_load = (
not shell.argument_exists('noautoload') and
shell.prompt("Auto load module at boot?", force_arg="autoload"))
print(""" print("""
Installing...""") Installing...""")
@ -59,7 +61,8 @@ Installing...""")
Settings take effect on next boot. Settings take effect on next boot.
""") """)
shell.prompt_reboot() if not shell.argument_exists('noreboot'):
shell.prompt_reboot(force_arg="reboot")
# Main function # Main function
if __name__ == "__main__": if __name__ == "__main__":