]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Add some type annotations.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 19 Oct 2021 20:32:19 +0000 (22:32 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 19 Oct 2021 20:32:19 +0000 (22:32 +0200)
wrpylib/wrvalidators.py

index f48bb30f5db1d03bf9549f5b7a3bd1bebe140747..8f8e0a7dd6fe8e9732d695ffc9d364c3be734b3c 100644 (file)
@@ -785,7 +785,7 @@ def wikibox_from_template(template, converter_dict):
     return result
 
 
-def wikibox_to_template(value, name, converter_dict):
+def wikibox_to_template(value, name, converter_dict) -> mwparserfromhell.nodes.template.Template:
     template = mwparserfromhell.nodes.template.Template(name)
     for key, converter in converter_dict.items():
         template.add(key, converter.to_str(value[key]))
@@ -853,12 +853,12 @@ def rodelbahnbox_to_template(value):
     return wikibox_to_template(value, RODELBAHNBOX_TEMPLATE_NAME, RODELBAHNBOX_DICT)
 
 
-def rodelbahnbox_from_str(value):
+def rodelbahnbox_from_str(value: str) -> Dict:
     """Returns an ordered dict."""
     return wikibox_from_str(value, RODELBAHNBOX_TEMPLATE_NAME, RODELBAHNBOX_DICT)
 
 
-def rodelbahnbox_to_str(value):
+def rodelbahnbox_to_str(value: Dict) -> str:
     template = rodelbahnbox_to_template(value)
     format_template_table(template, 20)
     return str(template)