| 5 | |
| 6 | |
| 7 | class ParserSchema(ma.Schema): |
| 8 | |
| 9 | module = ma.fields.String() |
| 10 | parserconfigs = ma.fields.List(ma.fields.Nested(ParserConfigSchema())) |
| 11 | |
| 12 | @ma.post_load() |
| 13 | def build_parser(self, data, **_): |
| 14 | return Parser(**data) |
| 15 | |
| 16 | @ma.post_dump() |
| 17 | def prepare_parser(self, data, **_): |
| 18 | for pc, index in enumerate(data['parserconfigs']): |
| 19 | if isinstance(pc, ParserConfig): |
| 20 | data['parserconfigs'][index] = pc.display |
| 21 | return data |
| 22 | |
| 23 | |
| 24 | class Parser(BaseObject): |
no test coverage detected