Make use of str.partition in Utils.parse_docstring
This commit is contained in:
parent
362bbf89f7
commit
59a5d1283a
1 changed files with 3 additions and 8 deletions
11
src/Utils.py
11
src/Utils.py
|
@ -337,14 +337,9 @@ def parse_docstring(s):
|
||||||
|
|
||||||
if line:
|
if line:
|
||||||
if line[0] == ":":
|
if line[0] == ":":
|
||||||
line_split = line.split(": ", 1)
|
key, _, value = line.partition(": ")
|
||||||
|
last_item = value
|
||||||
value = None
|
items[value] = value
|
||||||
if len(line_split) > 1:
|
|
||||||
value = line_split[1]
|
|
||||||
|
|
||||||
last_item = line_split[0][1:].lower()
|
|
||||||
items[last_item] = value
|
|
||||||
else:
|
else:
|
||||||
if last_item:
|
if last_item:
|
||||||
items[last_item] += " %s" % line
|
items[last_item] += " %s" % line
|
||||||
|
|
Loading…
Reference in a new issue