From b4d3cb514c96412c40b06969f29bf80a1b9dab6c Mon Sep 17 00:00:00 2001 From: expoonserver Date: Mon, 18 Jun 2018 23:17:05 +0100 Subject: [PATCH] Make sure that cave parser only reads .html files in cave_data dir (to stop foo~ causing 'duplicate cave' error) --- parsers/caves.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parsers/caves.py b/parsers/caves.py index 5c4ceb5..63c9f94 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -14,10 +14,11 @@ def readcaves(): #print "list of " for filename in os.walk(settings.ENTRANCEDESCRIPTIONS).next()[2]: #Should be a better way of getting a list of files if filename.endswith('.html'): - readentrance(filename) + readentrance(filename) print "Reading Caves" for filename in os.walk(settings.CAVEDESCRIPTIONS).next()[2]: #Should be a better way of getting a list of files - readcave(filename) + if filename.endswith('.html'): + readcave(filename) def readentrance(filename): with open(os.path.join(settings.ENTRANCEDESCRIPTIONS, filename)) as f: