mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-19 07:47:10 +00:00
fixing redundant messages
This commit is contained in:
@@ -183,7 +183,7 @@ def do_ARGE_cave(slug, caveid, areacode, svxid):
|
|||||||
else:
|
else:
|
||||||
print(f"not correct svxid {svxid} {sv}", file=sys.stderr)
|
print(f"not correct svxid {svxid} {sv}", file=sys.stderr)
|
||||||
|
|
||||||
print(f"{caveid} {rest}")
|
# print(f"ARGE {caveid} {rest}")
|
||||||
passages = "\n"
|
passages = "\n"
|
||||||
# ; Messteam: Uwe Kirsamer, Uli Nohlen, Aiko Schütz, Torben Schulz,Thomas Holder,Robert Winkler
|
# ; Messteam: Uwe Kirsamer, Uli Nohlen, Aiko Schütz, Torben Schulz,Thomas Holder,Robert Winkler
|
||||||
# ; Zeichner: Aiko Schütz, Robert Winkler
|
# ; Zeichner: Aiko Schütz, Robert Winkler
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ ROOTBLOCK = "rootblock"
|
|||||||
METRESINFEET = 3.28084
|
METRESINFEET = 3.28084
|
||||||
UNSEENS = "_unseens.svx"
|
UNSEENS = "_unseens.svx"
|
||||||
|
|
||||||
IGNOREFILES = ["dummy_file"]
|
IGNOREFILES = ["dummy_file", "_dummy_file"]
|
||||||
IGNOREPREFIX = ["surface", "kataster", "gpx", "deprecated"] #"fixedpts",
|
IGNOREPREFIX = ["surface", "kataster", "gpx", "deprecated"] #"fixedpts",
|
||||||
EXCEPTPREFIX = ["surface/terrain", "kataster/kataster-boundaries", "gpx/gpx_publish", "template", "docs", "deprecated", "subsections", "1623-and-1626-no-schoenberg-hs", "1623-and-1624-and-1626-and-1627", "1623-and-1626", "1623.svx", "1626.svx", "smk-system.svx"]
|
EXCEPTPREFIX = ["surface/terrain", "kataster/kataster-boundaries", "gpx", "template", "docs", "deprecated", "subsections", "1623-and-1626-no-schoenberg-hs", "1623-and-1624-and-1626-and-1627", "1623-and-1626", "1623.svx", "1626.svx", "smk-system.svx"]
|
||||||
# ignorenoncave = [
|
# ignorenoncave = [
|
||||||
# "caves-1623",
|
# "caves-1623",
|
||||||
# "caves-1623/2007-NEU",
|
# "caves-1623/2007-NEU",
|
||||||
@@ -737,7 +737,7 @@ class LoadingSurvex:
|
|||||||
splayalias = re.match(r"(?i)\s*station\s*\-\s*\.\.\s*$", line)
|
splayalias = re.match(r"(?i)\s*station\s*\-\s*\.\.\s*$", line)
|
||||||
if splayalias:
|
if splayalias:
|
||||||
self.flagsstar["splayalias"] = True
|
self.flagsstar["splayalias"] = True
|
||||||
print(line)
|
print(f"==splayalias {line} in {survexblock=} {survexblock.survexfile.path=}")
|
||||||
else:
|
else:
|
||||||
message = f"! Bad *ALIAS: '{line}' ({survexblock}) {survexblock.survexfile.path}"
|
message = f"! Bad *ALIAS: '{line}' ({survexblock}) {survexblock.survexfile.path}"
|
||||||
print(self.insp + message)
|
print(self.insp + message)
|
||||||
@@ -941,7 +941,7 @@ class LoadingSurvex:
|
|||||||
return
|
return
|
||||||
|
|
||||||
if debugprint:
|
if debugprint:
|
||||||
print(f"! LEG datastar type:{self.datastar['type'].upper()}++{survexblock.survexfile.path}\n{sline} ")
|
print(f"! LEG datastar type:{self.datastar['type'].upper()}++{survexblock.survexfile.path}\n{sline=} ")
|
||||||
if self.datastar["type"] == "passage":
|
if self.datastar["type"] == "passage":
|
||||||
return
|
return
|
||||||
if self.datastar["type"] == "cartesian":
|
if self.datastar["type"] == "cartesian":
|
||||||
@@ -1137,7 +1137,8 @@ class LoadingSurvex:
|
|||||||
refline = self.rx_ref_text.match(args)
|
refline = self.rx_ref_text.match(args)
|
||||||
if refline:
|
if refline:
|
||||||
# a textual reference such as "1996-1999 Not-KH survey book pp 92-95"
|
# a textual reference such as "1996-1999 Not-KH survey book pp 92-95"
|
||||||
print(f"{self.insp} *REF quoted text so ignored:{args} in {survexblock.survexfile.path}")
|
# this produces a lot of printout, so don't print it
|
||||||
|
# print(f"{self.insp} *REF quoted text so ignored:{args} in {survexblock.survexfile.path}")
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(args) < 4:
|
if len(args) < 4:
|
||||||
@@ -1268,7 +1269,7 @@ class LoadingSurvex:
|
|||||||
# stash_data_issue(parser='survex', message=message)
|
# stash_data_issue(parser='survex', message=message)
|
||||||
self.datastar["type"] = ls[0]
|
self.datastar["type"] = ls[0]
|
||||||
elif ls[0] == "cartesian": # We should not ignore this ?! Default for Germans ?
|
elif ls[0] == "cartesian": # We should not ignore this ?! Default for Germans ?
|
||||||
# message = " ! - *data {} blocks ignored. {}|{}" '{}' .format(ls[0].upper(), survexblock.name, args)
|
# message = f" ! - *data {ls[0].upper()} blocks ignored. {survexblock.name}|{args}"
|
||||||
# print(message)
|
# print(message)
|
||||||
# print(message,file=sys.stderr)
|
# print(message,file=sys.stderr)
|
||||||
# stash_data_issue(parser='survex', message=message)
|
# stash_data_issue(parser='survex', message=message)
|
||||||
@@ -1354,7 +1355,7 @@ class LoadingSurvex:
|
|||||||
print(f"BAD CAVE TYPE '{type(cave)}'{cave}' -- {key}'")
|
print(f"BAD CAVE TYPE '{type(cave)}'{cave}' -- {key}'")
|
||||||
for key in self.caveslist:
|
for key in self.caveslist:
|
||||||
cave = self.caveslist[key]
|
cave = self.caveslist[key]
|
||||||
print(f"Cave<{cave}> -- {key}")
|
# print(f"Cave<{cave}> -- {key}")
|
||||||
|
|
||||||
for f in IGNOREFILES:
|
for f in IGNOREFILES:
|
||||||
if svxid.lower().startswith(f):
|
if svxid.lower().startswith(f):
|
||||||
@@ -1405,8 +1406,8 @@ class LoadingSurvex:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def LoadSurvexFile(self, svxid):
|
def LoadSurvexFile(self, svxid):
|
||||||
"""Creates SurvexFile in the database, and SurvexDirectory if needed
|
"""Creates SurvexFile in the database if needed
|
||||||
Creates a new current survexfile and valid .survexdirectory
|
Creates a new current survexfile a
|
||||||
Inspects the parent folder of the survexfile and uses that to decide if this is
|
Inspects the parent folder of the survexfile and uses that to decide if this is
|
||||||
a cave we know.
|
a cave we know.
|
||||||
|
|
||||||
@@ -1425,7 +1426,7 @@ class LoadingSurvex:
|
|||||||
print("")
|
print("")
|
||||||
|
|
||||||
depth = " " * self.depthbegin
|
depth = " " * self.depthbegin
|
||||||
print("{:2}{} - NEW survexfile:'{}'".format(self.depthbegin, depth, svxid))
|
# print(f"{self.depthbegin:2}{depth} - NEW survexfile:'{svxid}' in LoadSurvexFile")
|
||||||
headpath = os.path.dirname(svxid)
|
headpath = os.path.dirname(svxid)
|
||||||
|
|
||||||
newfile, created = SurvexFile.objects.update_or_create(path=svxid)
|
newfile, created = SurvexFile.objects.update_or_create(path=svxid)
|
||||||
@@ -1855,7 +1856,7 @@ class LoadingSurvex:
|
|||||||
legslength=0.0,
|
legslength=0.0,
|
||||||
)
|
)
|
||||||
newsurvexblock.save()
|
newsurvexblock.save()
|
||||||
print(f"SB: #{newsurvexblock.id} '{newsurvexblock}' parent:{newsurvexblock.parent} f:{newsurvexblock.survexfile}")
|
# print(f"SB: #{newsurvexblock.id} '{newsurvexblock}' parent:{newsurvexblock.parent} f:{newsurvexblock.survexfile}")
|
||||||
newsurvexblock.title = (
|
newsurvexblock.title = (
|
||||||
"(" + survexblock.title + ")"
|
"(" + survexblock.title + ")"
|
||||||
) # copy parent inititally, overwrite if it has its own
|
) # copy parent inititally, overwrite if it has its own
|
||||||
@@ -1876,12 +1877,12 @@ class LoadingSurvex:
|
|||||||
try:
|
try:
|
||||||
survexblock.parent.save() # django insists on this although it is already saved !?
|
survexblock.parent.save() # django insists on this although it is already saved !?
|
||||||
except:
|
except:
|
||||||
print(survexblock.parent, file=sys.stderr)
|
print(f"{survexblock.parent=}", file=sys.stderr)
|
||||||
raise
|
raise
|
||||||
try:
|
try:
|
||||||
survexblock.save() # save to db at end of block
|
survexblock.save() # save to db at end of block
|
||||||
except:
|
except:
|
||||||
print(survexblock, file=sys.stderr)
|
print(f"{survexblock=}", file=sys.stderr)
|
||||||
raise
|
raise
|
||||||
confirm_team_on_trip(survexblock)
|
confirm_team_on_trip(survexblock)
|
||||||
# POP state ++++++++++++++
|
# POP state ++++++++++++++
|
||||||
@@ -1918,9 +1919,10 @@ class LoadingSurvex:
|
|||||||
|
|
||||||
elif self.rx_data.match(cmd):
|
elif self.rx_data.match(cmd):
|
||||||
if self.LoadSurvexDataNormal(survexblock, args):
|
if self.LoadSurvexDataNormal(survexblock, args):
|
||||||
|
# print(f"just normal data {cmd=} {args=} {survexblock=}", file=sys.stderr)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# Abort, we do not cope with this *data format
|
# returns false i.e. something we do not need to worry about
|
||||||
return
|
return
|
||||||
elif self.rx_alias.match(cmd):
|
elif self.rx_alias.match(cmd):
|
||||||
self.LoadSurvexAlias(survexblock, args)
|
self.LoadSurvexAlias(survexblock, args)
|
||||||
@@ -1945,6 +1947,8 @@ class LoadingSurvex:
|
|||||||
message=message,
|
message=message,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
if cmd not in ["equate", "export", "instrument", "calibrate", "cs", "require", "declination", "infer", "case"]:
|
||||||
|
print(f"FALLTHROUGH *{cmd=} {survexblock=} {survexblock.parent=}")
|
||||||
self.LoadSurvexFallThrough(survexblock, args, cmd)
|
self.LoadSurvexFallThrough(survexblock, args, cmd)
|
||||||
|
|
||||||
# this is a python generator idiom.
|
# this is a python generator idiom.
|
||||||
@@ -2037,7 +2041,7 @@ class LoadingSurvex:
|
|||||||
# -----------------
|
# -----------------
|
||||||
pop = self.includestack.pop()
|
pop = self.includestack.pop()
|
||||||
if pop != push:
|
if pop != push:
|
||||||
message = "!! ERROR mismatch *include pop!=push {}".format(pop, push, self.includestack)
|
message = "!! ERROR mismatch *include pop!=push {pop=} {push=} at {self.includestack)}"
|
||||||
print(message)
|
print(message)
|
||||||
print(message, file=flinear)
|
print(message, file=flinear)
|
||||||
print(message, file=sys.stderr)
|
print(message, file=sys.stderr)
|
||||||
@@ -2575,8 +2579,6 @@ def display_contents(blocks):
|
|||||||
sfs = SurvexFile.objects.filter(survexblock=b)
|
sfs = SurvexFile.objects.filter(survexblock=b)
|
||||||
for sf in sfs:
|
for sf in sfs:
|
||||||
print(f" SF {sf}")
|
print(f" SF {sf}")
|
||||||
# print(f" SD {sf.survexdirectory} {sf.survexdirectory.cave}")
|
|
||||||
# print(f" SD {sf.survexdirectory} {sf.survexdirectory.path}")
|
|
||||||
|
|
||||||
ws = Wallet.objects.filter(survexblock=b)
|
ws = Wallet.objects.filter(survexblock=b)
|
||||||
for w in ws:
|
for w in ws:
|
||||||
@@ -2683,8 +2685,7 @@ def parse_one_file(fpath): # --------------------------------------in progress--
|
|||||||
later.
|
later.
|
||||||
This all needs refactoring.
|
This all needs refactoring.
|
||||||
|
|
||||||
We also need to re-plumb the fileroot after importing, so that
|
We also need to re-plumb the fileroot after importing?
|
||||||
the new survexfile appears in the survexdirectory lists?
|
|
||||||
|
|
||||||
Rather than just arbitrarily creating something,
|
Rather than just arbitrarily creating something,
|
||||||
we should see if this is a known cave first. If it isn't dont' bother
|
we should see if this is a known cave first. If it isn't dont' bother
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ and the SRTM altitude are in <b>bold</b> if the discrepancy is more than 60m ver
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<p>If the survey station has a Cave associated with it, then the "unofficial name" of the cave
|
||||||
|
appears in the "Cave" column. If there is no cave, then the name of the Entrance appears in italics, which is usually the identifier for the Cave.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>These caves have GPS data directly on them, not via survex survey stations</h3>
|
<h3>These caves have GPS data directly on them, not via survex survey stations</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user