diff options
| author | 2018-10-02 17:47:28 +0100 | |
|---|---|---|
| committer | 2018-10-02 17:47:28 +0100 | |
| commit | 59a5d1283a01bd1d02bbcebc39e4ffd7c061a6e7 (patch) | |
| tree | c1e5d7bfbbe1103de4f7c06fe7983edf7901c4c4 /src | |
| parent | ... actually add src/IRCObject.py to git. that should have been present many (diff) | |
| signature | ||
Make use of str.partition in Utils.parse_docstring
Diffstat (limited to 'src')
| -rw-r--r-- | src/Utils.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Utils.py b/src/Utils.py index ebf82f82..2f1782bc 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -337,14 +337,9 @@ def parse_docstring(s): if line: if line[0] == ":": - line_split = line.split(": ", 1) - - value = None - if len(line_split) > 1: - value = line_split[1] - - last_item = line_split[0][1:].lower() - items[last_item] = value + key, _, value = line.partition(": ") + last_item = value + items[value] = value else: if last_item: items[last_item] += " %s" % line |
