mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-19 13:37:09 +00:00
All working
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user