summaryrefslogtreecommitdiffstats
path: root/parsers/subcaves.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2020-07-29 22:54:09 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2020-07-29 22:54:09 +0100
commit95b9daca801a18a5b3c099b8d6277f97e37b1240 (patch)
tree41a37c9f34a9c1021858b50dfd53fc1a31d4bcb1 /parsers/subcaves.py
parent42456e8e98bee298f874cd2e7f90d0666965807b (diff)
downloadtroggle-95b9daca801a18a5b3c099b8d6277f97e37b1240.tar.gz
troggle-95b9daca801a18a5b3c099b8d6277f97e37b1240.tar.bz2
troggle-95b9daca801a18a5b3c099b8d6277f97e37b1240.zip
remove commented out code, more comments
Diffstat (limited to 'parsers/subcaves.py')
-rw-r--r--parsers/subcaves.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/parsers/subcaves.py b/parsers/subcaves.py
deleted file mode 100644
index 89aa9b6..0000000
--- a/parsers/subcaves.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# '''
-# This module is the part of troggle that parses descriptions of cave parts (subcaves) from the legacy html files and saves them in the troggle database as instances of the model Subcave. Unfortunately, this parser can not be very flexible because the legacy format is poorly structured.
-# '''
-# import sys
-# import os
-# import re
-# import logging
-
-# from django.conf import settings
-
-# from troggle.core.models_caves import Cave, NewSubCave
-# from utils import save_carefully
-
-# def getLinksInCaveDescription(cave):
- # '''
- # Returns all HTML <a href> tags from a given cave as a list of tuples
- # in the format ('filename.html','Description')
- # '''
- # pattern='<a href=\"(.*?)\">(.*?)</a>'
- # if cave.underground_description:
- # return re.findall(pattern,cave.underground_description)
- # else:
- # return []
-
-# def importSubcaves(cave):
- # for link in getLinksInCaveDescription(cave):
- # try:
- # subcaveFilePath=os.path.join(
- # settings.EXPOWEB,
- # os.path.dirname(cave.description_file),
- # link[0])
- # subcaveFile=open(subcaveFilePath,'rb')
- # description=subcaveFile.read() # decode('iso-8859-1').encode('utf-8')
-
- # #lookupAttribs={'title':link[1], 'cave':cave}
- # #nonLookupAttribs={'description':description}
- # lookupAttribs={}
- # nonLookupAttribs={}
- # newSubcave=save_carefully(NewSubCave,lookupAttribs=lookupAttribs,nonLookupAttribs=nonLookupAttribs)
-
- # logging.info("Added " + str(newSubcave) + " to " + str(cave))
- # except IOError:
- # logging.info("Subcave import couldn't open "+subcaveFilePath)
-
-# def getLinksInSubcaveDescription(subcave):
- # pattern='<a href=\"(.*?)\">(.*?)</a>'
- # if subcave.description:
- # return re.findall(pattern,subcave.description)
- # else:
- # return []
-
-# def getLinksInAllSubcaves():
- # bigList=[]
- # for subcave in NewSubCave.objects.all():
- # bigList+=getLinksInSubcaveDescription(subcave)
- # return bigList
-
-# def importAllSubcaves():
- # for cave in Cave.objects.all():
- # importSubcaves(cave)