summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-04-26 18:37:59 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-04-26 18:37:59 +0100
commitbd647b99ec7bd4ae9d3b8b7a6f5b0c274f90bb2e (patch)
treec1ef3ef82bdc1cd28534017ab11126a4d0a7273b
parent0997fd09018455935e7ff28f10e001577f3a8dac (diff)
downloadtroggle-bd647b99ec7bd4ae9d3b8b7a6f5b0c274f90bb2e.tar.gz
troggle-bd647b99ec7bd4ae9d3b8b7a6f5b0c274f90bb2e.tar.bz2
troggle-bd647b99ec7bd4ae9d3b8b7a6f5b0c274f90bb2e.zip
rename tunnelname as dwgname
-rw-r--r--core/models/survex.py2
-rw-r--r--parsers/surveys.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/core/models/survex.py b/core/models/survex.py
index b4dadc9..207a47f 100644
--- a/core/models/survex.py
+++ b/core/models/survex.py
@@ -201,7 +201,7 @@ class SingleScan(models.Model):
class DrawingFile(models.Model):
dwgpath = models.CharField(max_length=200)
- tunnelname = models.CharField(max_length=200)
+ dwgname = models.CharField(max_length=200)
bfontcolours = models.BooleanField(default=False) # UNUSED now, can be deleted
manyscansfolders = models.ManyToManyField("Wallet") # implicitly links via folders to scans to SVX files
scans = models.ManyToManyField("SingleScan") # implicitly links via scans to SVX files
diff --git a/parsers/surveys.py b/parsers/surveys.py
index 73161f2..a0cf520 100644
--- a/parsers/surveys.py
+++ b/parsers/surveys.py
@@ -150,7 +150,7 @@ def find_tunnel_scan(dwgfile, path):
elif path and not re.search(r"\.(?:png|jpg|pdf|jpeg|gif|pdf)$(?i)", path):
name = os.path.split(path)[1]
- rdwgfilel = DrawingFile.objects.filter(tunnelname=name)
+ rdwgfilel = DrawingFile.objects.filter(dwgname=name)
if len(rdwgfilel):
message = "! Two paths with same name [{}]: {}".format(path, name)
print(message)
@@ -206,7 +206,7 @@ def settherionfileinfo(filetuple):
# scrap blownout -projection plan -scale [-81.0 -42.0 216.0 -42.0 0.0 0.0 7.5438 0.0 m]
for xth_me in rx_xth_me.findall(ttext):
- message = f'! Un-parsed image filename: {therionfile.tunnelname} : {xth_me.split()[-3]} - {therionfile.dwgpath}'
+ message = f'! Un-parsed image filename: {therionfile.dwgname} : {xth_me.split()[-3]} - {therionfile.dwgpath}'
#print(message)
DataIssue.objects.create(parser='Therion', message=message)
findimageinsert(therionfile, xth_me)
@@ -214,7 +214,7 @@ def settherionfileinfo(filetuple):
for inp in rx_input.findall(ttext):
# if this 'input' is a .th2 file we have already seen, then we can assign this as a sub-file
# but we would need to disentangle to get the current path properly
- message = f'! Un-set Therion .th2 input: - {therionfile.tunnelname} : {inp} - {therionfile.dwgpath}'
+ message = f'! Un-set Therion .th2 input: - {therionfile.dwgname} : {inp} - {therionfile.dwgpath}'
#print(message)
DataIssue.objects.create(parser='Therion', message=message)
findimportinsert(therionfile, inp)
@@ -278,17 +278,17 @@ def load_drawings_files():
drawingsdirs.append(lf) # lunatic! adding to list in middle of list while loop!
elif f[-4:] == ".xml":
# Always creates new
- dwgfile = DrawingFile(dwgpath=lf, tunnelname=os.path.split(f[:-4])[1])
+ dwgfile = DrawingFile(dwgpath=lf, dwgname=os.path.split(f[:-4])[1])
dwgfile.save()
all_xml.append(('xml',dwgfile))
elif f[-3:] == ".th":
# Always creates new
- dwgfile = DrawingFile(dwgpath=lf, tunnelname=os.path.split(f[:-4])[1])
+ dwgfile = DrawingFile(dwgpath=lf, dwgname=os.path.split(f[:-4])[1])
dwgfile.save()
all_xml.append(('th',dwgfile))
elif f[-4:] == ".th2":
# Always creates new
- dwgfile = DrawingFile(dwgpath=lf, tunnelname=os.path.split(f[:-4])[1])
+ dwgfile = DrawingFile(dwgpath=lf, dwgname=os.path.split(f[:-4])[1])
dwgfile.save()
all_xml.append(('th2',dwgfile))