Commit 93ab4311 authored by Willi Rath's avatar Willi Rath

Fix indentation and decorator for static method

parent 18d6ca56
......@@ -404,7 +404,7 @@ class ReadmeRenderer(Renderer):
super(ReadmeRenderer, self).__init__(yaml_dict=yaml_dict, *args,
**kwargs)
@static
@staticmethod
def _maybe_include_credentials(yaml_dict):
if "credential_files" not in yaml_dict:
yaml_dict["maybe_credentials"] = ""
......@@ -417,44 +417,44 @@ class ReadmeRenderer(Renderer):
yaml_dict["maybe_credentials"] = textwrap.dedent(cred_string)
return yaml_dict
@static
def _maybe_include_acknowledgements(yaml_dict):
if "acknowledgements" not in yaml_dict:
yaml_dict["acknowledgements_parsed"] = ""
else:
ack_string = """\
## How to acknowledge the original data set?
Please consider to include the following in the
acknowledgements of any manuscript that uses the data:
> {acknowledgements}
""".format(yaml_dict["acknowledgements"])
yaml_dict["acknowledgements_parsed"] = textwrap.dedent(
ack_string)
return yaml_dict
@static
def _maybe_include_citations(yaml_dict):
if ("citations" not in yaml_dict or
len(yaml_dict["citations"]) == 0):
yaml_dict["citations_parsed"] = ""
else:
cite_string = """\
## How to cite the data set?
The following references provide details about the data
set:
""".format(yaml_dict["citations"])
yaml_dict["citations_parsed"] = textwrap.dedent(
cite_string)
for ct in yaml_dict["citations"]:
yaml_dict["citations_parsed"] += """\
- {text}, doi:{doi}
""".format(ct)
return yaml_dict
@staticmethod
def _maybe_include_acknowledgements(yaml_dict):
if "acknowledgements" not in yaml_dict:
yaml_dict["acknowledgements_parsed"] = ""
else:
ack_string = """\
## How to acknowledge the original data set?
Please consider to include the following in the
acknowledgements of any manuscript that uses the data:
> {acknowledgements}
""".format(yaml_dict["acknowledgements"])
yaml_dict["acknowledgements_parsed"] = textwrap.dedent(
ack_string)
return yaml_dict
@staticmethod
def _maybe_include_citations(yaml_dict):
if ("citations" not in yaml_dict or
len(yaml_dict["citations"]) == 0):
yaml_dict["citations_parsed"] = ""
else:
cite_string = """\
## How to cite the data set?
The following references provide details about the data
set:
""".format(yaml_dict["citations"])
yaml_dict["citations_parsed"] = textwrap.dedent(
cite_string)
for ct in yaml_dict["citations"]:
yaml_dict["citations_parsed"] += """\
- {text}, doi:{doi}
""".format(ct)
return yaml_dict
def _make_file_executable(file_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment