From 179ba32c5a6326d15299f6211048f1d195163515 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 24 Oct 2025 22:27:59 +0300 Subject: [PATCH] moved stuff --- parsers/drawings.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/parsers/drawings.py b/parsers/drawings.py index cd7e38f..08cb2e0 100644 --- a/parsers/drawings.py +++ b/parsers/drawings.py @@ -15,8 +15,6 @@ for tunnel and therion files todo = """ - Rename functions more consistently between tunnel and therion variants -- fix missed embedded survex files and their *ref wallet - - Refactor to use pathlib instead of whacky resetting of loop variable inside loop to scan sub-folders. This will definitely break at some point.. @@ -26,6 +24,17 @@ todo = """ Tries to link the scrap (Therion format) to the referenced therion scrap """ +rx_xth_me = re.compile(r"xth_me_image_insert.*{.*}$", re.MULTILINE) +rx_scrap = re.compile(r"^survey (\w*).*$", re.MULTILINE) +rx_input = re.compile(r"^input ", re.MULTILINE) +rx_line = re.compile(r"^line ", re.MULTILINE) +rx_ref = re.compile(r"^#?\s?ref\s*\:?\s*([^\s\t]*)", re.MULTILINE) + +rx_skpath = re.compile(r" 1: @@ -125,7 +134,7 @@ def findwalletimage(therionfile, foundpath): mscansdir = rx_wallet.search(foundpath) if mscansdir: scanswalletl = Wallet.objects.filter(walletname=mscansdir.group(1)) - # This should be changed to properly detect if a list of folders is returned and do something sensible, not just pick the first. + # This should be changed to properly detect if a list of folders is returned and do something sensible, not just pick the first. Use the __in idom if len(scanswalletl): wallet = scanswalletl[0] if len(scanswalletl) > 1: @@ -163,14 +172,6 @@ def findimportinsert(therionfile, imp): pass -rx_xth_me = re.compile(r"xth_me_image_insert.*{.*}$", re.MULTILINE) -rx_scrap = re.compile(r"^survey (\w*).*$", re.MULTILINE) -rx_input = re.compile(r"^input ", re.MULTILINE) -rx_line = re.compile(r"^line ", re.MULTILINE) -rx_ref = re.compile(r"^#?\s?ref\s*\:?\s*([^\s\t]*)", re.MULTILINE) -# ref: - - def settherionfileinfo(filetuple): """Read in the drawing file contents and sets values on the dwgfile object""" thtype, therionfile = filetuple @@ -231,11 +232,6 @@ def settherionfileinfo(filetuple): therionfile.save() -rx_skpath = re.compile(r"