troggle-unchained/parsers/imports.py

59 lines
1.7 KiB
Python
Raw Normal View History

2020-06-16 16:07:36 +01:00
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
2020-06-18 21:50:16 +01:00
#from django.urls import reverse, resolve
2020-06-16 16:07:36 +01:00
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")
2020-06-16 19:27:32 +01:00
print(" - Survex Blocks")
2020-06-27 18:00:24 +01:00
troggle.parsers.survex.LoadSurvexBlocks()
2020-06-16 19:27:32 +01:00
print(" - Survex entrances x/y/z Positions")
2020-06-16 16:07:36 +01:00
troggle.parsers.survex.LoadPos()
2020-06-30 15:24:42 +01:00
def import_loadpos():
# when this import is moved to the top with the rest it all crashes horribly
import troggle.parsers.survex
print(" - Survex entrances x/y/z Positions")
troggle.parsers.survex.LoadPos()
def import_drawingsfiles():
print("Importing Drawings files")
troggle.parsers.surveys.LoadDrawingFiles()
2020-06-16 16:07:36 +01:00