-
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.
- Loading branch information
1 parent
9ee3405
commit 37142e6
Showing
4 changed files
with
30 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
_MAP = { | ||
"y": True, | ||
"yes": True, | ||
"t": True, | ||
"true": True, | ||
"on": True, | ||
"1": True, | ||
"n": False, | ||
"no": False, | ||
"f": False, | ||
"false": False, | ||
"off": False, | ||
"0": False, | ||
} | ||
|
||
|
||
def strtobool(value): | ||
try: | ||
return _MAP[str(value).lower()] | ||
except KeyError as error: | ||
raise ValueError(f'"{value}" is not a valid bool value') from error |
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