From 7437ac1d382509da35f245b18f44fb9c81e2ceec Mon Sep 17 00:00:00 2001 From: Wookey Date: Wed, 22 May 2013 02:33:47 +0100 Subject: [PATCH] Add checking for compass too Only print filenames on error by default --- parsers/survex.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/parsers/survex.py b/parsers/survex.py index ab51155..cbc91bd 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -24,13 +24,20 @@ def LoadSurvexLineLeg(survexblock, stardata, sline, comment): print "Stardata:", stardata print "Line:", ls survexleg.tape = 1000 - try: + try: lclino = ls[stardata["clino"]] except: - print "Tape misread in", survexblock.survexfile.path + print "Clino misread in", survexblock.survexfile.path print "Stardata:", stardata print "Line:", ls - lcompass = ls[stardata["compass"]] + lclino = error + try: + lcompass = ls[stardata["compass"]] + except: + print "Compass misread in", survexblock.survexfile.path + print "Stardata:", stardata + print "Line:", ls + lcompass = error if lclino == "up": survexleg.compass = 0.0 survexleg.clino = 90.0 @@ -82,8 +89,9 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines): text = [ ] stardata = stardatadefault teammembers = [ ] - - print "Reading file:", survexblock.survexfile.path + +# uncomment to print out all files during parsing +# print "Reading file:", survexblock.survexfile.path while True: svxline = fin.readline().decode("latin1") if not svxline: