-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix pylint warnings for boot.py, code.py and logs.py
- Loading branch information
Showing
6 changed files
with
122 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
""" | ||
Disable concurrent write protections on the storage. | ||
This is especially necessary for dev builds since we need to change the files | ||
on the board for hot reloading. | ||
""" | ||
|
||
import storage | ||
|
||
storage.remount("/", readonly=False, disable_concurrent_write_protection=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
""" | ||
A very bare-bones logging implementation | ||
for the bottom pane of the Web UI. | ||
""" | ||
|
||
import json | ||
|
||
logs = [] | ||
|
||
|
||
def consume() -> str: | ||
""" | ||
Convert all the log entries from the module's global mutable | ||
list to json return them, clearing the list after the dump. | ||
""" | ||
dump = json.dumps(logs) | ||
logs.clear() | ||
return dump | ||
|
||
|
||
def info(message: str): | ||
""" | ||
Add a log entry with the message prepended with the info marker | ||
""" | ||
logs.append("info: " + message) | ||
|
||
|
||
def warn(message: str): | ||
""" | ||
Add a log entry with the message prepended with the warning marker | ||
""" | ||
logs.append("warning: " + message) |