From 52736ca1b34f7f004e68ae00a03fa876edf8199d Mon Sep 17 00:00:00 2001 From: Martin Green Date: Fri, 10 Aug 2012 19:02:13 +0200 Subject: Made a prospecting guide and fixed survex station description. Removed parsing of underground descriptions to wikis. --- parsers/caves.py | 1 + parsers/descriptions.py | 45 --------------------------------------------- parsers/survex.py | 2 +- 3 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 parsers/descriptions.py (limited to 'parsers') diff --git a/parsers/caves.py b/parsers/caves.py index 43d3688..1c8bf2f 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -73,6 +73,7 @@ def readentrance(filename): e.save() primary = True for slug in slugs: + print slug, filename cs = models.EntranceSlug(entrance = e, slug = slug, primary = primary) diff --git a/parsers/descriptions.py b/parsers/descriptions.py deleted file mode 100644 index cf744fe..0000000 --- a/parsers/descriptions.py +++ /dev/null @@ -1,45 +0,0 @@ -from django.conf import settings -import core.models as models -import os -from utils import html_to_wiki, get_html_body, get_html_title - -pages = [(["smkridge", "204", "ariston-rigging.html"], "ariston-rigging"), - (["smkridge", "204", "ariston.html"], "ariston"), - (["smkridge", "204", "bivvy.html"], "bivvy"), - (["smkridge", "204", "bridge.html"], "bridge"), - (["smkridge", "204", "entrance-rigging.html"], "entrance-rigging"), - (["smkridge", "204", "entrance.html"], "entrance"), - (["smkridge", "204", "midlevel.html"], "midlevel"), - (["smkridge", "204", "millennium.html"], "millennium"), - (["smkridge", "204", "nopain.html"], "nopain"), - (["smkridge", "204", "razordance.html"], "razordance"), - (["smkridge", "204", "rhino.html"], "rhino"), - (["smkridge", "204", "sbview.html"], "sbview"), - (["smkridge", "204", "subway.html"], "subway"), - (["smkridge", "204", "swings.html"], "swings"), - (["smkridge", "204", "treeumphant.html"], "treeumphant"), - (["smkridge", "204", "uworld.html"], "uworld"), ] - - -def getDescriptions(): - """Creates objects in the database for each item in the list 'pages' . """ - for filelocation, name in pages: - f = open(os.path.join(settings.EXPOWEB, *filelocation), "r") - html = f.read() - - cd = models.CaveDescription(short_name = name, - long_name = unicode(get_html_title(html), "latin1"), - description = unicode(get_html_body(html), "latin1")) - cd.save() - -def parseDescriptions(): - """Turns the HTML in each cave description into wikicode""" - for cd in models.CaveDescription.objects.all(): - cd.description = html_to_wiki(cd.description) - - cd.save() - -def parseDescriptionsOnCaveObjects(): - for cave in models.Cave.objects.all(): - cave.underground_description=html_to_wiki(unicode(cave.underground_description)) - cave.save() \ No newline at end of file diff --git a/parsers/survex.py b/parsers/survex.py index d43c303..ce81a72 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -256,7 +256,7 @@ def LoadPos(): try: ss = models.SurvexStation.objects.lookup(name) except: - print name + print "%s not parsed in survex" % name ss.x = float(x) ss.y = float(y) ss.z = float(z) -- cgit v1.2.3