summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py.setfix.diff
blob: daca7490df7693391a420a48ce8dd32852026f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff -r 04cc6773cbb0 parsers/survex.py
--- a/parsers/survex.py	Tue Jul 02 18:13:27 2013 +0100
+++ b/parsers/survex.py	Tue Jul 02 20:03:51 2013 +0100
@@ -83,6 +83,8 @@
 
 stardatadefault = { "type":"normal", "t":"leg", "from":0, "to":1, "tape":2, "compass":3, "clino":4 }
 stardataparamconvert = { "length":"tape", "bearing":"compass", "gradient":"clino" }
+#default characters for various items
+starsetchars = { "blank":"/t ", "decimal":".", "comment":";", "eol":"/l/n", "keyword":"*", "minus":"-", "names":"_-", "omit":"-", "plus":"+", "root":"/", "separator":"." } 
 
 def RecursiveLoad(survexblock, survexfile, fin, textlines):
     iblankbegins = 0
@@ -200,10 +202,14 @@
 
         elif cmd == "fix":
             survexblock.MakeSurvexStation(line.split()[0])
+        elif cmd == "set":
+            ls = line.lower().split()
+            # set item to use chars given
+            starsetchars = { ls[0]:ls[1] }
+            # what unsets this back to defaults at end of block?
         else:
-            assert cmd in [ "sd", "include", "units", "entrance", "data", "flags", "title", "export", "instrument", "calibrate", "set", "infer"], (cmd, line, survexblock)
-        
-        
+            assert cmd in [ "sd", "include", "units", "entrance", "data", "flags", "title", "export", "instrument", "calibrate", "infer"], (cmd, line, survexblock)
+                
 
 def ReloadSurvexCave(survex_cave):
     cave = models.Cave.objects.get(kataster_number=survex_cave)