From 3d07cec1431e15963572ca2b684cbe359f8d60d0 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 15 Dec 2025 17:06:05 +0000 Subject: [PATCH] All working --- parsers/drawings.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/parsers/drawings.py b/parsers/drawings.py index 9313391..0796650 100644 --- a/parsers/drawings.py +++ b/parsers/drawings.py @@ -156,7 +156,7 @@ def _process_reference(dwgfile, path, parser_label="Tunnel"): suffix = Path(path).suffix.lower() if suffix in IMAGE_EXTS: # It's an image/scanned file type; we don't treat it as a referenced drawing - return + return None, None # Not an image file: perhaps a reference to another drawing (no ext or other ext) name = Path(path).name @@ -175,30 +175,6 @@ def _process_reference(dwgfile, path, parser_label="Tunnel"): return None, None - # Not a wallet reference; check image extension and possibly drawing-to-drawing reference - suffix = Path(path).suffix.lower() - if suffix in IMAGE_EXTS: - # It's an image/scanned file type; we don't treat it as a referenced drawing - return - - # Not an image file: perhaps a reference to another drawing (no ext or other ext) - name = Path(path).name - rdwgfilel = DrawingFile.objects.filter(dwgname=name) # Check if it is another drawing file we have already seen - if len(rdwgfilel): - if len(rdwgfilel) > 1: - plist = [] - for df in rdwgfilel: - plist.append(df.dwgpath) - message = f"- Warning {len(rdwgfilel)} files named '{name}' {plist}" # should not be a problem? - print(message) - DataIssue.objects.create(parser="Tunnel", message=message, url=f"/dwgdataraw/{path}") - rdwgfile = rdwgfilel[0] - if hasattr(dwgfile, 'dwgcontains'): - dwgfile.dwgcontains.add(rdwgfile) - - dwgfile.save() - - def findwalletimage(therionfile, foundpath): """Tries to link the drawing file (Therion format) to the referenced image (scan) file""" # Delegate to the unified reference processor for consistent behaviour