-
Notifications
You must be signed in to change notification settings - Fork 42
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 #4 from riscv/resolve-issue-#3
Made logging optional in check_specs
- Loading branch information
Showing
7 changed files
with
66 additions
and
48 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,3 +1,3 @@ | ||
from pkgutil import extend_path | ||
__path__ = extend_path(__path__, __name__) | ||
__version__ = "1.0.0" | ||
__version__ = "1.0.2" |
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,2 +1,20 @@ | ||
class ValidationError(Exception): | ||
pass | ||
def __init__(self,message,errors): | ||
super().__init__(message) | ||
self.message=message | ||
self.errors=errors | ||
def __errPrint__(self,foo, space=' '): | ||
''' | ||
Function to petty print the error from cerberus. | ||
''' | ||
error = '' | ||
for key in foo.keys(): | ||
error += space + str(key) + ":" | ||
if isinstance(foo[key][0], dict): | ||
error += "\n" + self.__errPrint__(foo[key][0], space + space) | ||
else: | ||
error += str(foo[key][0]) | ||
error += "\n" | ||
return error.rstrip() | ||
def __str__(self): | ||
return self.message+"\n"+self.__errPrint__(self.errors) |
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