diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-06-16 16:07:36 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-06-16 16:07:36 +0100 |
commit | 1b693da5ed7430d1d49327a05bbd376970e34b61 (patch) | |
tree | 771173ab5147a22faaf8b205e2f3d11cdb630816 /parsers/imports.py | |
parent | 4c44a504edbfe55b023cfc810ee73109a45738bd (diff) | |
download | troggle-1b693da5ed7430d1d49327a05bbd376970e34b61.tar.gz troggle-1b693da5ed7430d1d49327a05bbd376970e34b61.tar.bz2 troggle-1b693da5ed7430d1d49327a05bbd376970e34b61.zip |
break recursive import cycle
Diffstat (limited to 'parsers/imports.py')
-rw-r--r-- | parsers/imports.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/parsers/imports.py b/parsers/imports.py new file mode 100644 index 0000000..65228f8 --- /dev/null +++ b/parsers/imports.py @@ -0,0 +1,62 @@ +import sys +import os + +import django +from django.core import management +from django.db import connection, close_old_connections, connections +from django.contrib.auth.models import User +from django.http import HttpResponse +from django.core.urlresolvers import reverse + +import troggle.settings +import troggle.parsers.caves +import troggle.parsers.people +import troggle.parsers.surveys +import troggle.parsers.logbooks +import troggle.parsers.QMs + +def import_caves(): + print("Importing Caves to ",end="") + print(django.db.connections.databases['default']['NAME']) + troggle.parsers.caves.readcaves() + +def import_people(): + print("Importing People (folk.csv) to ",end="") + print(django.db.connections.databases['default']['NAME']) + troggle.parsers.people.LoadPersonsExpos() + +def import_surveyscans(): + print("Importing Survey Scans") + troggle.parsers.surveys.LoadListScans() + +def import_logbooks(): + print("Importing Logbooks") + troggle.parsers.logbooks.LoadLogbooks() + +def import_QMs(): + print("Importing QMs (old caves)") + troggle.parsers.QMs.Load_QMs() + +def import_survex(): + # when this import is moved to the top with the rest it all crashes horribly + import troggle.parsers.survex + print("Importing Survex Blocks") + troggle.parsers.survex.LoadAllSurvexBlocks() + +def import_survexpos(): + import troggle.parsers.survex + print("Importing Survex x/y/z Positions") + troggle.parsers.survex.LoadPos() + +def import_surveyimgs(): + """This appears to store data in unused objects. The code is kept + for future re-working to manage progress against notes, plans and elevs. + """ + #import troggle.parsers.surveys + print("NOT Importing survey images") + #troggle.parsers.surveys.parseSurveys(logfile=settings.LOGFILE) + +def import_tunnelfiles(): + print("Importing Tunnel files") + troggle.parsers.surveys.LoadTunnelFiles() + |