summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWookey <wookey@wookware.org>2013-05-22 02:10:58 +0100
committerWookey <wookey@wookware.org>2013-05-22 02:10:58 +0100
commitd1ac659d4f7c41ceba745aeafab3df9c70e0d92c (patch)
tree5ce85c2a82150edbc12ffcc4fd6ce352161aa250
parentbb1989d0f0bd9ba0bb71b8f07abfe4ddd2e028c2 (diff)
downloadtroggle-d1ac659d4f7c41ceba745aeafab3df9c70e0d92c.tar.gz
troggle-d1ac659d4f7c41ceba745aeafab3df9c70e0d92c.tar.bz2
troggle-d1ac659d4f7c41ceba745aeafab3df9c70e0d92c.zip
Add error check in place where parser died
-rw-r--r--parsers/survex.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index ce81a72..ab51155 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -24,7 +24,12 @@ def LoadSurvexLineLeg(survexblock, stardata, sline, comment):
print "Stardata:", stardata
print "Line:", ls
survexleg.tape = 1000
- lclino = ls[stardata["clino"]]
+ try:
+ lclino = ls[stardata["clino"]]
+ except:
+ print "Tape misread in", survexblock.survexfile.path
+ print "Stardata:", stardata
+ print "Line:", ls
lcompass = ls[stardata["compass"]]
if lclino == "up":
survexleg.compass = 0.0
@@ -78,6 +83,7 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines):
stardata = stardatadefault
teammembers = [ ]
+ print "Reading file:", survexblock.survexfile.path
while True:
svxline = fin.readline().decode("latin1")
if not svxline: