summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
authormartin speleo <martin.speleo@gmail.com>2009-07-04 00:28:28 +0100
committermartin speleo <martin.speleo@gmail.com>2009-07-04 00:28:28 +0100
commitc132477f80342a5174719922889fc04056de482e (patch)
treecb11dcf2940d0fdbc25ffe06e33f49a2ffb4b697 /parsers/survex.py
parent92635f6f684e846c8b287040a40375211fc7e408 (diff)
downloadtroggle-c132477f80342a5174719922889fc04056de482e.tar.gz
troggle-c132477f80342a5174719922889fc04056de482e.tar.bz2
troggle-c132477f80342a5174719922889fc04056de482e.zip
[svn] Added cavedescription and new subcave.
Changed parsers/survex to read *title into subcave
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index dad081b..2236d7b 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -28,7 +28,8 @@ re_include_no_extension = re.compile(r"^\s*\*include\s+([^\s]*)\s*$", re.IGNOREC
flags = {"begin": re.compile(r"^\s*\*begin\s+(.*?)\s*$", re.IGNORECASE),
"end": re.compile(r"^\s*\*end\s+(.*?)\s*$", re.IGNORECASE),
"date": re.compile(r"^\s*\*date\s+(.*?)\s*$", re.IGNORECASE),
- "team": re.compile(r"^\s*\*team\s+(.*?)\s*$", re.IGNORECASE)}
+ "team": re.compile(r"^\s*\*team\s+(.*?)\s*$", re.IGNORECASE),
+ "title": re.compile(r"^\s*\*title\s+(.*?)\s*$", re.IGNORECASE)}
def fileIterator(directory, filename):
survex_file = os.path.join(directory, filename + ".svx")
@@ -132,6 +133,9 @@ def make_model(name, parent, iter_lines, sf, c, l):
team.append((survex_file, h.groups()))
else:
print ("Role not found: " + line + " in: " + sf).encode('ascii', 'xmlcharrefreplace')
+ elif res["title"]:
+ nsb, success = models.NewSubCave.objects.get_or_create(name = res["title"].groups()[0])
+
m.text = m.text + line
saveEnd(survex_file, count)