summaryrefslogtreecommitdiffstats
path: root/parsers/imports.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-01-19 21:18:42 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-01-19 21:18:42 +0000
commitba2ae6cd8213b5e5a9674e2ea1451c881fb8719c (patch)
tree20db00814a91eb14e6683ae00d9da0a4d082c685 /parsers/imports.py
parent0f8fe0e290b065fca531fd61e9b48ec565a33915 (diff)
downloadtroggle-ba2ae6cd8213b5e5a9674e2ea1451c881fb8719c.tar.gz
troggle-ba2ae6cd8213b5e5a9674e2ea1451c881fb8719c.tar.bz2
troggle-ba2ae6cd8213b5e5a9674e2ea1451c881fb8719c.zip
reformatted using black
Diffstat (limited to 'parsers/imports.py')
-rw-r--r--parsers/imports.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/parsers/imports.py b/parsers/imports.py
index d8fa87d..d59c792 100644
--- a/parsers/imports.py
+++ b/parsers/imports.py
@@ -4,8 +4,7 @@ import sys
import django
from django.contrib.auth.models import User
from django.core import management
-from django.db import (close_old_connections, connection, connections,
- transaction)
+from django.db import close_old_connections, connection, connections, transaction
from django.http import HttpResponse
import troggle.parsers.caves
@@ -16,46 +15,53 @@ import troggle.parsers.QMs
import troggle.parsers.scans
import troggle.settings
-'''Master data import.
+"""Master data import.
Used only by databaseReset.py and online controlpanel.
-'''
+"""
+
def import_caves():
- print("-- Importing Caves to ",end="")
- print(django.db.connections.databases['default']['NAME'])
+ 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'])
+ print("-- Importing People (folk.csv) to ", end="")
+ print(django.db.connections.databases["default"]["NAME"])
with transaction.atomic():
troggle.parsers.people.load_people_expos()
+
def import_surveyscans():
print("-- Importing Survey Scans")
with transaction.atomic():
troggle.parsers.scans.load_all_scans()
+
def import_logbooks():
print("-- Importing Logbooks")
with transaction.atomic():
troggle.parsers.logbooks.LoadLogbooks()
+
def import_logbook(year=2022):
print(f"-- Importing Logbook {year}")
with transaction.atomic():
troggle.parsers.logbooks.LoadLogbook(year)
+
def import_QMs():
print("-- Importing old QMs for 161, 204, 234 from CSV files")
with transaction.atomic():
troggle.parsers.QMs.Load_QMs()
+
def import_survex():
# when this import is moved to the top with the rest it all crashes horribly
print("-- Importing Survex and Entrance Positions")
with transaction.atomic():
- import troggle.parsers.survex
+ import troggle.parsers.survex
print(" - Survex Blocks")
with transaction.atomic():
troggle.parsers.survex.LoadSurvexBlocks()
@@ -63,23 +69,26 @@ def import_survex():
with transaction.atomic():
troggle.parsers.survex.LoadPositions()
+
def import_ents():
# when this import is moved to the top with the rest it all crashes horribly
print(" - Survex entrances x/y/z Positions")
with transaction.atomic():
- import troggle.parsers.survex
+ import troggle.parsers.survex
+
troggle.parsers.survex.LoadPositions()
+
def import_loadpos():
# when this import is moved to the top with the rest it all crashes horribly
- import troggle.parsers.survex
+ import troggle.parsers.survex
+
print(" - Survex entrances x/y/z Positions")
with transaction.atomic():
troggle.parsers.survex.LoadPositions()
+
def import_drawingsfiles():
print("-- Importing Drawings files")
with transaction.atomic():
troggle.parsers.drawings.load_drawings_files()
-
-