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] target = cite_tuple[1]
# Create article objects for phantom citations # Create article objects for phantom citations
if target not in article_by_title: 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 # Interlink citations
if article_by_title[target].player is None: if article_by_title[target].player is None:
article.pcites.add(target) article.pcites.add(target)

View File

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