summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-01-19 18:30:05 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-01-19 18:30:05 +0000
commite5a9330a91d9d79adc4735e8850357d37c234c5c (patch)
tree7fa760a441c1cc8c429f162ce48b2b98c66fdcf0 /databaseReset.py
parent1b70ccea3e782b171560e997499c19015e8b5980 (diff)
downloadtroggle-e5a9330a91d9d79adc4735e8850357d37c234c5c.tar.gz
troggle-e5a9330a91d9d79adc4735e8850357d37c234c5c.tar.bz2
troggle-e5a9330a91d9d79adc4735e8850357d37c234c5c.zip
reordering import statements using isort
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 6a30f28..8ae0f15 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -1,12 +1,13 @@
-import sys
+import json
+import locale
import os
+import resource
+import sys
import time
import timeit
-import json
-import resource
-import locale
import settings
+
""" Command-line utility for loading cave data files into troggle's database.
The command line options select which combination of classes of data will be imported,
@@ -34,20 +35,22 @@ except:
raise
print(f" - Memory footprint after loading Django: {resource.getrusage(resource.RUSAGE_SELF)[2] / 1024.0:.3f} MB")
-from troggle.core.models.troggle import DataIssue
-import troggle.core.models.survex
-
+from django.contrib.auth.models import User
from django.core import management
-from django.db import connection, close_old_connections, connections
+from django.db import (close_old_connections, connection, connections,
+ transaction)
from django.http import HttpResponse
from django.urls import reverse
-from django.contrib.auth.models import User
-from django.db import transaction
-from troggle.core.utils import get_process_memory
+import troggle.core.models.survex
from troggle.core.models.caves import Cave, Entrance
-from troggle.parsers.imports import import_caves, import_people, import_surveyscans, import_ents, \
- import_logbooks, import_logbook, import_QMs, import_survex, import_loadpos, import_drawingsfiles
+from troggle.core.models.troggle import DataIssue
+from troggle.core.utils import get_process_memory
+from troggle.parsers.imports import (import_caves, import_drawingsfiles,
+ import_ents, import_loadpos,
+ import_logbook, import_logbooks,
+ import_people, import_QMs, import_survex,
+ import_surveyscans)
if os.geteuid() == 0:
# This protects the server from having the wrong file permissions written on logs and caches