clean up after Mark changed things a bit

This commit is contained in:
Philip Sargent 2023-07-24 15:26:36 +03:00
parent 3bd7684d4b
commit c31615b1ff

View File

@ -435,23 +435,34 @@ class LoadingSurvex:
self.currentdate = self.inheritdate # unecessary duplication self.currentdate = self.inheritdate # unecessary duplication
# Not an error, so not put in DataIssues, but is printed to debug output # Not an error, so not put in DataIssues, but is printed to debug output
message = ( message = (
f"- No *date. INHERITING date from ({survexblock.parent})-{survexblock.parent.survexfile.path} to ({survexblock})-{survexblock.survexfile.path} {self.inheritdate:%Y-%m-%d}" f"- No *date. INHERITING date '{self.inheritdate:%Y-%m-%d}' from ({survexblock.parent})-{survexblock.parent.survexfile.path} to ({survexblock})-{survexblock.survexfile.path} {self.inheritdate:%Y-%m-%d}"
) )
print(self.insp + message) print(self.insp + message)
# stash_data_issue( # stash_data_issue(
# parser="survex", message=message, url=None, sb=(survexblock.survexfile.path) # child # parser="survex", message=message, url=None, sb=(survexblock.survexfile.path) # child
# ) # )
if survexblock.survexfile != survexblock.parent.survexfile: if survexblock.survexfile != survexblock.parent.survexfile:
# This is noteworthy, however. # This is noteworthy, however.
message = (
f"- Warning *date INHERITED from DIFFERENT file:\n ({survexblock.parent})-{survexblock.parent.survexfile.path} to ({survexblock})-{survexblock.survexfile.path} {self.inheritdate:%Y-%m-%d}\n {self.stackbegin} {self.inheritdate:%Y-%m-%d}" if survexblock.parent.name == "rootblock":
) # Not a sensible thing to inherit a date from, even if a date exists, which it shouldn't...
print(self.insp + message) message = (
stash_data_issue( f"- No *date. But not sensible to inherit from rootblock. From ({survexblock.parent})-{survexblock.parent.survexfile.path} to ({survexblock})-{survexblock.survexfile.path} {self.inheritdate:%Y-%m-%d}"
parser="survex", message=message, url=None, sb=(survexblock.parent.survexfile.path) # PARENT )
) print(self.insp + message)
# stash_data_issue(
return self.inheritdate # parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
# )
return
else:
message = (
f"- Warning *date '{self.inheritdate:%Y-%m-%d}' INHERITED from DIFFERENT file:\n ({survexblock.parent})-{survexblock.parent.survexfile.path} to ({survexblock})-{survexblock.survexfile.path} {self.inheritdate:%Y-%m-%d}\n {self.stackbegin} {self.inheritdate:%Y-%m-%d}"
)
print(self.insp + message)
stash_data_issue(
parser="survex", message=message, url=None, sb=(survexblock.parent.survexfile.path) # PARENT
)
return self.inheritdate
else: else:
# This is not an error in the Expo dataset. # This is not an error in the Expo dataset.
# Many files just holding *include lines do not have dates. # Many files just holding *include lines do not have dates.
@ -2203,7 +2214,7 @@ def FindAndLoadSurvex(survexblockroot):
) )
check_team_cache() check_team_cache()
print(f" -- Now loading the previously-omitted survex files.", file=sys.stderr) print(f" -- Now loading the previously-omitted survex files.", file=sys.stderr)
print(f" - (except the exceptions: {excpts})", file=sys.stderr) print(f" - (except: {excpts})", file=sys.stderr)
with open(Path(settings.SURVEX_DATA, UNSEENS), "w") as u: with open(Path(settings.SURVEX_DATA, UNSEENS), "w") as u:
u.write( u.write(