Skip to content
Snippets Groups Projects
Commit aecb6fbd authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

empty docstring fix

parent 30a4576f
No related branches found
No related tags found
6 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!446empty docstring fix
......@@ -24,21 +24,13 @@ def doc(doc_string: str, template="saqc_methods", source="function_string"):
return docFunc
def getDocstringIndent(doc_string: list) -> str:
def getDocstringIndent(lines: list) -> str:
"""returns a whitespace string matching the indent size of the passed docstring_list"""
regular_line = False
current_line = 0
while not regular_line:
# check if line is empty
if len(doc_string[current_line]) == 0 or re.match(
" *$", doc_string[current_line]
):
current_line += 1
else:
regular_line = True
# get indent-string (smth. like " ")
indent_str = re.match(" *", doc_string[current_line])[0]
return indent_str
for line in lines:
if len(line) == 0 or re.match(" *$", line):
continue
return re.match(" *", line)[0]
return ""
def getSections(doc_string: list, indent_str: str) -> dict:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment