diff resfinder/cge/out/template.py @ 0:55051a9bc58d draft default tip

Uploaded
author dcouvin
date Mon, 10 Jan 2022 20:06:07 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resfinder/cge/out/template.py	Mon Jan 10 20:06:07 2022 +0000
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+from result import Result
+from exceptions import CGECoreOutTypeError
+
+
+class CGEOutTemplate(dict):
+
+    def __init__(self, template):
+        if(template not in Result.beone_defs):
+            raise CGECoreOutTypeError(
+                "Unknown template given. Template given: {}. Template must be"
+                " one of:\n{}"
+                .format(template, list(Result.beone_defs.keys())))
+
+        for key in Result.beone_defs.keys():
+            self[key] = None
+        self["type"] = template