mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 07:11:52 +00:00
Better debug messages
This commit is contained in:
parent
d0a05af9c6
commit
b428a87f1a
@ -153,11 +153,11 @@ class SurvexBlock(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
ordering = ("id",)
|
ordering = ("id",)
|
||||||
|
|
||||||
def __str__(self):
|
# def __str__(self):
|
||||||
return "[SurvexBlock:" + str(self.name) + "-path:" + str(self.survexpath) + "-cave:" + str(self.cave) + "]"
|
# return "[SurvexBlock:" + str(self.name) + "-path:" + str(self.survexpath) + "-cave:" + str(self.cave) + "]"
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name and str(self.name) or "no name"
|
return self.name and str(self.name) or "no_name-#" + str(self.id)
|
||||||
|
|
||||||
def isSurvexBlock(self): # Function used in templates
|
def isSurvexBlock(self): # Function used in templates
|
||||||
return True
|
return True
|
||||||
|
@ -391,18 +391,34 @@ class LoadingSurvex:
|
|||||||
if survexblock.parent.name == "troggle_unseens":
|
if survexblock.parent.name == "troggle_unseens":
|
||||||
# Bolluxed up if we try to inherit from this random junk, so don't.
|
# Bolluxed up if we try to inherit from this random junk, so don't.
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.currentdate:
|
if self.currentdate:
|
||||||
if self.inheritdate:
|
# already set
|
||||||
message = (
|
return
|
||||||
f"- INHERITING ({survexblock.parent})>({survexblock}) {survexblock.survexfile.path} '{self.inheritdate:%Y-%m-%d}'"
|
|
||||||
)
|
if self.inheritdate:
|
||||||
print(self.insp + message)
|
# Not an error, so not put in DataIssues, but is printed to debug output
|
||||||
stash_data_issue(
|
message = (
|
||||||
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
f"- No *date. INHERITING date from ({survexblock})-{survexblock.survexfile.path} to ({survexblock.parent}) to {self.inheritdate:%Y-%m-%d}"
|
||||||
)
|
)
|
||||||
survexblock.date = self.inheritdate
|
print(self.insp + message)
|
||||||
return self.inheritdate
|
# stash_data_issue(
|
||||||
|
# parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
||||||
|
# )
|
||||||
|
survexblock.date = self.inheritdate
|
||||||
|
self.currentdate = self.inheritdate # unecessary duplication
|
||||||
|
return self.inheritdate
|
||||||
|
else:
|
||||||
|
# This is not an error in the Expo dataset.
|
||||||
|
# Many files just holding *include lines do not have dates.
|
||||||
|
# Hardly _any_ of the ARGE survex files have dates !
|
||||||
|
pass
|
||||||
|
# message = f" ! No survexblock.date inheritable in '{survexblock}' in '{survexblock.survexfile.path}', setting to 1976"
|
||||||
|
# print(self.insp + message)
|
||||||
|
# stash_data_issue(
|
||||||
|
# parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
||||||
|
# )
|
||||||
|
# expoyear = "1976"
|
||||||
return
|
return
|
||||||
|
|
||||||
def fix_anonymous(self, survexblock):
|
def fix_anonymous(self, survexblock):
|
||||||
@ -1300,15 +1316,10 @@ class LoadingSurvex:
|
|||||||
survexblock.survexfile.cave.slug()
|
survexblock.survexfile.cave.slug()
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
if survexblock.date:
|
|
||||||
expoyear = str(survexblock.date.year)
|
self.fix_undated(survexblock) # null-op if already set
|
||||||
else:
|
expoyear = str(survexblock.date.year)
|
||||||
message = f" ! No survexblock.date in {survexblock} in '{survexblock.survexfile.path}', setting to 1976"
|
|
||||||
print(insp + message)
|
|
||||||
stash_data_issue(
|
|
||||||
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
|
||||||
)
|
|
||||||
expoyear = "1976"
|
|
||||||
try:
|
try:
|
||||||
qm = QM.objects.create(
|
qm = QM.objects.create(
|
||||||
number=qm_no,
|
number=qm_no,
|
||||||
@ -1336,8 +1347,7 @@ class LoadingSurvex:
|
|||||||
expoyear=expoyear,
|
expoyear=expoyear,
|
||||||
cave=survexblock.survexfile.cave,
|
cave=survexblock.survexfile.cave,
|
||||||
)
|
)
|
||||||
print(qms)
|
message = f" ! QM{qm_no} FAIL to create {qm_nearest} in'{survexblock.survexfile.path}' found {len(qms)}:{qms}"
|
||||||
message = f" ! QM{qm_no} FAIL to create {qm_nearest} in'{survexblock.survexfile.path}'"
|
|
||||||
print(insp + message)
|
print(insp + message)
|
||||||
stash_data_issue(
|
stash_data_issue(
|
||||||
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
||||||
|
Loading…
Reference in New Issue
Block a user