Fix minor code quality issues

This commit is contained in:
Tim Van Baak 2018-10-16 11:45:22 -07:00
parent 8abcf059b0
commit 590bf958de
2 changed files with 5 additions and 4 deletions

View File

@ -143,7 +143,8 @@ class LexiconArticle:
target = cite_tuple[1]
# Create article objects for phantom citations
if target not in article_by_title:
article_by_title[target] = LexiconArticle(None, sys.maxsize, target, "<p><i>This entry hasn't been written yet.</i></p>", {})
article_by_title[target] = LexiconArticle(None, sys.maxsize, target,
"<p><i>This entry hasn't been written yet.</i></p>", {})
# Interlink citations
if article_by_title[target].player is None:
article.pcites.add(target)

View File

@ -51,7 +51,7 @@ def load_config(name):
line = f.readline()
while line:
# Skim lines until a value definition begins
conf_match = re.match(">>>([^>]+)>>>\s+", line)
conf_match = re.match(r">>>([^>]+)>>>\s+", line)
if not conf_match:
line = f.readline()
continue
@ -59,11 +59,11 @@ def load_config(name):
conf = conf_match.group(1)
conf_value = ""
line = f.readline()
conf_match = re.match("<<<{0}<<<\s+".format(conf), line)
conf_match = re.match(r"<<<{0}<<<\s+".format(conf), line)
while line and not conf_match:
conf_value += line
line = f.readline()
conf_match = re.match("<<<{0}<<<\s+".format(conf), line)
conf_match = re.match(r"<<<{0}<<<\s+".format(conf), line)
if not line:
# TODO Not this
raise SystemExit("Reached EOF while reading config value {}".format(conf))