summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorexpoonserver <devnull@localhost>2018-06-18 23:17:05 +0100
committerexpoonserver <devnull@localhost>2018-06-18 23:17:05 +0100
commitb4d3cb514c96412c40b06969f29bf80a1b9dab6c (patch)
treeaeb2355247be89656031b628625d41300beec7e8
parent01f17dc1cc39274791a733322802020a71684ca0 (diff)
downloadtroggle-b4d3cb514c96412c40b06969f29bf80a1b9dab6c.tar.gz
troggle-b4d3cb514c96412c40b06969f29bf80a1b9dab6c.tar.bz2
troggle-b4d3cb514c96412c40b06969f29bf80a1b9dab6c.zip
Make sure that cave parser only reads .html files in cave_data dir (to stop foo~ causing 'duplicate cave' error)
-rw-r--r--parsers/caves.py5
1 files 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 <Slug> <Filename>"
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: