From: philipp Date: Tue, 2 Feb 2016 21:10:48 +0000 (+0000) Subject: Omitted parameter "name" in some functions. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/bacc3eb8932683ab203187068c5d2987d11e2e12 Omitted parameter "name" in some functions. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2458 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wrpylib/wrvalidators.py b/wrpylib/wrvalidators.py index 09bba89..b332a48 100644 --- a/wrpylib/wrvalidators.py +++ b/wrpylib/wrvalidators.py @@ -670,9 +670,8 @@ class ValueErrorList(ValueError): pass -def wikibox_from_template(template, name, converter_dict): - if template.name.strip() != name: - raise ValueError('Box name has to be "{}"'.format(name)) +def wikibox_from_template(template, converter_dict): + """Returns an ordered dict.""" result = OrderedDict() exceptions_dict = OrderedDict() # check values @@ -711,7 +710,7 @@ def template_from_str(value, name): def wikibox_from_str(value, name, converter_dict): template = template_from_str(value, name) - return wikibox_from_template(template, name, converter_dict) + return wikibox_from_template(template, converter_dict) def wikibox_to_str(value, name, converter_dict): @@ -752,14 +751,16 @@ RODELBAHNBOX_DICT = OrderedDict([ def rodelbahnbox_from_template(template): - return wikibox_from_template(template, RODELBAHNBOX_TEMPLATE_NAME, RODELBAHNBOX_DICT) + """Returns an ordered dict.""" + return wikibox_from_template(template, RODELBAHNBOX_DICT) def rodelbahnbox_to_template(value): - return wikibox_to_template(value, RODELBAHNBOX_TEMPLATE_NAME, RODELBAHNBOX_DICT) + return wikibox_to_template(value, RODELBAHNBOX_DICT, RODELBAHNBOX_TEMPLATE_NAME) def rodelbahnbox_from_str(value): + """Returns an ordered dict.""" return wikibox_from_str(value, RODELBAHNBOX_TEMPLATE_NAME, RODELBAHNBOX_DICT) @@ -792,6 +793,7 @@ GASTHAUSBOX_DICT = OrderedDict([ def gasthausbox_from_template(template): + """Returns an ordered dict.""" return wikibox_from_template(template, GASTHAUSBOX_TEMPLATE_NAME, GASTHAUSBOX_DICT) @@ -800,6 +802,7 @@ def gasthausbox_to_template(value): def gasthausbox_from_str(value): + """Returns an ordered dict.""" return wikibox_from_str(value, GASTHAUSBOX_TEMPLATE_NAME, GASTHAUSBOX_DICT)