aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-05-25 12:58:07 +0100
committerGravatar jesopo2019-05-25 12:58:07 +0100
commitd0634bb54ea538333f75aa39e22e78c31729bf61 (patch)
tree02c8412915376968b07111fa8e6509b3a649150a
parentActually save blacklist setting when reenabling a module (diff)
signature
Don't store hashflags as a dict before returning them - allow duplicate keys
-rw-r--r--src/utils/parse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/parse.py b/src/utils/parse.py
index c23417f5..ca7e6ed4 100644
--- a/src/utils/parse.py
+++ b/src/utils/parse.py
@@ -2,7 +2,7 @@ import io, typing
COMMENT_TYPES = ["#", "//"]
def hashflags(filename: str) -> typing.List[typing.Tuple[str, str]]:
- hashflags = {}
+ hashflags = []
with io.open(filename, mode="r", encoding="utf8") as f:
for line in f:
line = line.strip("\n")
@@ -17,8 +17,8 @@ def hashflags(filename: str) -> typing.List[typing.Tuple[str, str]]:
break
elif line.startswith("--"):
hashflag, sep, value = line[2:].partition(" ")
- hashflags[hashflag] = value if sep else None
- return list(hashflags.items())
+ hashflags.append([hashflag, value if sep else None])
+ return hashflags
class Docstring(object):
def __init__(self, description: str, items: typing.Dict[str, str],