From 042507cb910e9c166e207301be4cca101eb4b902 Mon Sep 17 00:00:00 2001 From: expoonserver Date: Thu, 26 Jun 2014 02:34:19 +0100 Subject: [PATCH] Replace assert on unrecognised commands with print, so that a minor parsing issue doesn't completely kill a parsing update. Add parsing for requires and alias commands. --- parsers/survex.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parsers/survex.py b/parsers/survex.py index cbc91bd..3f490ea 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -183,6 +183,10 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines): survextitle = models.SurvexTitle(survexblock=survexblock, title=line.strip('"'), cave=survexblock.cave) survextitle.save() + elif cmd == "require": + # should we check survex version available for processing? + pass + elif cmd == "data": ls = line.lower().split() stardata = { "type":ls[0] } @@ -200,8 +204,10 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines): elif cmd == "fix": survexblock.MakeSurvexStation(line.split()[0]) + else: - assert cmd in [ "sd", "include", "units", "entrance", "data", "flags", "title", "export", "instrument", "calibrate", "set", "infer"], (cmd, line, survexblock) + if not cmd in [ "sd", "include", "units", "entrance", "data", "flags", "title", "export", "instrument", "calibrate", "set", "infer", "alias" ]: + print ("Unrecognised command in line:", cmd, line, survexblock)