From 590bf958def73306603d6379b0c21cea1baa266e Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 16 Oct 2018 11:45:22 -0700 Subject: [PATCH] Fix minor code quality issues --- src/article.py | 3 ++- src/utils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/article.py b/src/article.py index bbab806..be39ab9 100644 --- a/src/article.py +++ b/src/article.py @@ -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, "

This entry hasn't been written yet.

", {}) + article_by_title[target] = LexiconArticle(None, sys.maxsize, target, + "

This entry hasn't been written yet.

", {}) # Interlink citations if article_by_title[target].player is None: article.pcites.add(target) diff --git a/src/utils.py b/src/utils.py index ea47974..e3e7e4a 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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))