diff options
-rw-r--r-- | core/views/uploads.py | 9 | ||||
-rw-r--r-- | parsers/survex.py | 10 |
2 files changed, 12 insertions, 7 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py index 091534a..b275d2a 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -211,9 +211,14 @@ def scanupload(request, path=None): wallet = "2022#01" # improve this later year = wallet[:4] - if int(year) <= 1998: - #print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') + try: + if int(year) <= 1998: + #print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') + return(oldwallet(request, path)) + except: + # if nonumeric wallet name for example return(oldwallet(request, path)) + if str(wallet).lower().endswith('indexpages'): # print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') diff --git a/parsers/survex.py b/parsers/survex.py index 4a5bba4..7b94005 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -202,7 +202,7 @@ class LoadingSurvex(): print(self.insp+message) DataIssue.objects.create(parser='survex', message=message, url=get_offending_filename(survexblock.survexfile.path)) else: - message = "! Bad svx command: [*{}] {} ({}) {}".format(cmd, line, survexblock, survexblock.survexfile.path) + message = "! Bad unrecognised svx command: [*{}] {} ({}) {}".format(cmd, line, survexblock, survexblock.survexfile.path) print(self.insp+message) DataIssue.objects.create(parser='survex', message=message, url=get_offending_filename(survexblock.survexfile.path)) @@ -313,7 +313,7 @@ class LoadingSurvex(): survexblock.date = datetime.strptime(line, '%Y') # sets to January 1st setdate(year) else: - message = "! DATE unrecognised '{}' ({}) {}".format(line, survexblock, survexblock.survexfile.path) + message = "! Error DATE unrecognised '{}' ({}) {}".format(line, survexblock, survexblock.survexfile.path) print(self.insp+message) DataIssue.objects.create(parser='survex', message=message, url=get_offending_filename(survexblock.survexfile.path)) @@ -424,7 +424,7 @@ class LoadingSurvex(): except: message = ' ! Value Error: Compass not found in line %s in %s' % (ls, survexblock.survexfile.path) print(self.insp+message) - DataIssue.objects.create(parser='survexleg', message=message) + DataIssue.objects.create(parser='survexleg', message=message, url=get_offending_filename(survexblock.survexfile.path)) lcompass = invalid_compass try: @@ -626,7 +626,7 @@ class LoadingSurvex(): # ls = ["normal", "from", "to", "tape", "compass", "clino" ] for i in range(1, len(ls)): # len[0] is "normal" if ls[i].lower() =="newline": - message = f" ! - ABORT *data statement has NEWLINE in it in {survexblock.survexfile.path}. Not parsed by torggle. '{args}'" + message = f" ! - ABORT *data statement has NEWLINE in it in {survexblock.survexfile.path}. Not parsed by troggle. '{args}'" print(message) print(message,file=sys.stderr) DataIssue.objects.create(parser='survex', message=message, url=get_offending_filename(survexblock.survexfile.path)) @@ -735,7 +735,7 @@ class LoadingSurvex(): #print("\n"+message) #print("\n"+message,file=sys.stderr) return - message = f" ! Error: FAILURE '{headpath}' while creating '{includelabel}' at depth:'{depth}'. Not a cave or in the ignore list:'{self.ignoreprefix}'" + message = f" ! Error: FAILURE '{headpath}' while creating '{includelabel}' at depth:[{depth}]. Not a cave or in the ignore list:'{self.ignoreprefix}'" # getting this triggered for gpx/2018 (cavern error) but not for gpx/2017 (no content). print("\n"+message) print("\n"+message,file=sys.stderr) |