2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

Better error messaged and url

This commit is contained in:
Philip Sargent 2022-03-29 15:31:25 +01:00
parent efeb0efd1e
commit 7f16bca7f7
2 changed files with 6 additions and 6 deletions

View File

@ -140,7 +140,7 @@ def scanupload(request, path=None):
if int(wnumber) == 0:
prev = f'{int(wnumber):02d}'
wurl = f"/scanupload/{wallet}"
wurl = f"/scanupload/{wallet}".replace('#', ':')
wallet = wallet.replace(':','#')
dirpath = Path(settings.SURVEY_SCANS, year, wallet)
contents_path = dirpath / contentsjson

View File

@ -190,7 +190,7 @@ class LoadingSurvex():
pass # we ignore all these, which is fine.
else:
if cmd in ["include", "data", "flags", "title", "entrance","set", "units", "alias", "ref"]:
message = "! Unparsed [*{}]: '{}' {}".format(cmd, line, survexblock.survexfile.path)
message = "! Unparsed [*{}]: '{}' {} - not an error (probably)".format(cmd, line, survexblock.survexfile.path)
print((self.insp+message))
DataIssue.objects.create(parser='survex', message=message)
else:
@ -466,7 +466,7 @@ class LoadingSurvex():
if argsgps:
yr, letterx, wallet = argsgps.groups()
else:
message = " ! Wallet *REF '{}' in '{}' ".format(args, survexblock.survexfile.path)
message = " ! Wallet *REF '{}' malformed id in '{}' ".format(args, survexblock.survexfile.path)
print(self.insp+message)
DataIssue.objects.create(parser='survex', message=message, url=url)
return
@ -484,7 +484,7 @@ class LoadingSurvex():
refscan = "%s#%s%s" % (yr, letterx, wallet)
try:
if int(wallet)>100:
if int(wallet)>99:
message = " ! Wallet *REF {} - too big in '{}'".format(refscan, survexblock.survexfile.path)
print((self.insp+message))
DataIssue.objects.create(parser='survex', message=message, url=url)
@ -498,11 +498,11 @@ class LoadingSurvex():
print(manywallets[0])
survexblock.save()
if len(manywallets) > 1:
message = " ! Wallet *REF {} - {} scan folders from DB search in {} -- parsing continues".format(refscan, len(manywallets), survexblock.survexfile.path)
message = " ! Wallet *REF {} - more than one found {} scan folders in {}".format(refscan, len(manywallets), survexblock.survexfile.path)
print((self.insp+message))
DataIssue.objects.create(parser='survex', message=message, url=url)
else:
message = " ! Wallet *REF '{}' - NOT found in DB search '{}' -- parsing continues".format(refscan, survexblock.survexfile.path)
message = " ! Wallet *REF '{}' - NOT found '{}'".format(refscan, survexblock.survexfile.path)
print((self.insp+message))
DataIssue.objects.create(parser='survex', message=message, url=url)