generated from BrianPugh/python-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from BrianPugh/remove-stacktrace
Fully remove belay-internal stacktrace for install/run/exec cli commands
- Loading branch information
Showing
4 changed files
with
22 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
from belay.pyboard import PyboardException | ||
|
||
help_port = "Port (like /dev/ttyUSB0) or WebSocket (like ws://192.168.1.100) of device." | ||
help_password = "Password for communication methods (like WebREPL) that require authentication." # nosec # noqa: S105 | ||
|
||
|
||
class remove_stacktrace: # noqa: N801 | ||
def __enter__(self): | ||
return self | ||
|
||
def __exit__(self, exc_type, exc_value, traceback): | ||
if exc_type is not None and issubclass(exc_type, PyboardException): | ||
print(exc_value) | ||
return True # suppress the full stack trace | ||
else: | ||
return False # let other exceptions propagate normally |
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