-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: configure logging correctly for all of scriv but just scriv
- Loading branch information
Ned Batchelder
committed
Oct 18, 2023
1 parent
a19026e
commit 70360a4
Showing
7 changed files
with
33 additions
and
30 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
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,21 +1,5 @@ | ||
"""Specialized exceptions for scriv.""" | ||
|
||
import functools | ||
import sys | ||
|
||
|
||
class ScrivException(Exception): | ||
"""Any exception raised by scriv.""" | ||
|
||
|
||
def scriv_command(func): | ||
"""Decorate a command so that ScrivException ends cleanly (no traceback).""" | ||
|
||
@functools.wraps(func) | ||
def _wrapped(*args, **kwargs): | ||
try: | ||
func(*args, **kwargs) | ||
except ScrivException as exc: | ||
sys.exit(str(exc)) | ||
|
||
return _wrapped |
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