Last active
March 2, 2019 15:36
-
-
Save barrucadu/4185c88abf20cdf3bd2c232299574af7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| if 'document_type' not in raw: | |
| raise NoDocumentType() | |
| document_type = raw['document_type'] | |
| document_type_parser = f'parse_type_{document_type}' | |
| if document_type_parser not in globals(): | |
| raise UnknownDocumentType(document_type) | |
| return globals()[document_type_parser](raw) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment