Add checking for compass too

Only print filenames on error by default
This commit is contained in:
Wookey 2013-05-22 02:33:47 +01:00
parent b002ca6cc7
commit 7437ac1d38

View File

@ -27,10 +27,17 @@ def LoadSurvexLineLeg(survexblock, stardata, sline, comment):
try: try:
lclino = ls[stardata["clino"]] lclino = ls[stardata["clino"]]
except: except:
print "Tape misread in", survexblock.survexfile.path print "Clino misread in", survexblock.survexfile.path
print "Stardata:", stardata print "Stardata:", stardata
print "Line:", ls print "Line:", ls
lclino = error
try:
lcompass = ls[stardata["compass"]] lcompass = ls[stardata["compass"]]
except:
print "Compass misread in", survexblock.survexfile.path
print "Stardata:", stardata
print "Line:", ls
lcompass = error
if lclino == "up": if lclino == "up":
survexleg.compass = 0.0 survexleg.compass = 0.0
survexleg.clino = 90.0 survexleg.clino = 90.0
@ -83,7 +90,8 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines):
stardata = stardatadefault stardata = stardatadefault
teammembers = [ ] teammembers = [ ]
print "Reading file:", survexblock.survexfile.path # uncomment to print out all files during parsing
# print "Reading file:", survexblock.survexfile.path
while True: while True:
svxline = fin.readline().decode("latin1") svxline = fin.readline().decode("latin1")
if not svxline: if not svxline: