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
commit96533882c7c251dc039359b36dd2830c02976b1f (patch)
tree10a8ae763e73c77b2f72e5219ccb73ad96bd2702 /parsers/survex.py
parent82cc8e1fe79f94dc2986961cf594ae2fedb63326 (diff)
downloadtroggle-96533882c7c251dc039359b36dd2830c02976b1f.tar.gz
troggle-96533882c7c251dc039359b36dd2830c02976b1f.tar.bz2
troggle-96533882c7c251dc039359b36dd2830c02976b1f.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)