Mercurial > repos > dcouvin > resfinder4
comparison resfinder/cge/out/template.py @ 0:55051a9bc58d draft default tip
Uploaded
author | dcouvin |
---|---|
date | Mon, 10 Jan 2022 20:06:07 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:55051a9bc58d |
---|---|
1 #!/usr/bin/env python3 | |
2 | |
3 from result import Result | |
4 from exceptions import CGECoreOutTypeError | |
5 | |
6 | |
7 class CGEOutTemplate(dict): | |
8 | |
9 def __init__(self, template): | |
10 if(template not in Result.beone_defs): | |
11 raise CGECoreOutTypeError( | |
12 "Unknown template given. Template given: {}. Template must be" | |
13 " one of:\n{}" | |
14 .format(template, list(Result.beone_defs.keys()))) | |
15 | |
16 for key in Result.beone_defs.keys(): | |
17 self[key] = None | |
18 self["type"] = template |