summaryrefslogtreecommitdiffstats
path: root/parsers/surveys.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/surveys.py')
-rw-r--r--parsers/surveys.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/parsers/surveys.py b/parsers/surveys.py
index bc99e1a..cbfa60e 100644
--- a/parsers/surveys.py
+++ b/parsers/surveys.py
@@ -15,6 +15,8 @@ import settings
#from troggle.core.models import *
#from troggle.core.models_caves import *
from troggle.core.models_survex import SingleScan, ScansFolder, TunnelFile
+from troggle.core.models import DataIssue
+
def get_or_create_placeholder(year):
""" All surveys must be related to a logbookentry. We don't have a way to
@@ -177,22 +179,24 @@ def SetTunnelfileInfo(tunnelfile):
tunnelfile.save()
-def LoadTunnelFiles():
- tunneldatadir = settings.TUNNEL_DATA
+def LoadDrawingFiles():
+ drawdatadir = settings.TUNNEL_DATA
TunnelFile.objects.all().delete()
- tunneldirs = [ "" ]
- while tunneldirs:
- tunneldir = tunneldirs.pop()
- for f in os.listdir(os.path.join(tunneldatadir, tunneldir)):
+ DataIssue.objects.filter(parser='drawings').delete()
+
+ drawingsdirs = [ "" ]
+ while drawingsdirs:
+ drawdir = drawingsdirs.pop()
+ for f in os.listdir(os.path.join(drawdatadir, drawdir)):
if f[0] == "." or f[-1] == "~":
continue
- lf = os.path.join(tunneldir, f)
- ff = os.path.join(tunneldatadir, lf)
+ lf = os.path.join(drawdir, f)
+ ff = os.path.join(drawdatadir, lf)
if os.path.isdir(ff):
- tunneldirs.append(lf)
+ drawingsdirs.append(lf)
elif f[-4:] == ".xml":
tunnelfile = TunnelFile(tunnelpath=lf, tunnelname=os.path.split(f[:-4])[1])
tunnelfile.save()
- for tunnelfile in TunnelFile.objects.all():
- SetTunnelfileInfo(tunnelfile)
+ for drawfile in TunnelFile.objects.all():
+ SetTunnelfileInfo(drawfile)