summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2020-06-01 00:42:48 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2020-06-01 00:42:48 +0100
commit8c4c2ad1cf90b40c9ba219dceb0282fa1dd3fdb0 (patch)
tree2a9bbb9d7e8616462a5838e462029933eefb93cc /databaseReset.py
parentf949bb8dc0d5c5e6c37a5464a8e67d6c5fc8c254 (diff)
downloadtroggle-8c4c2ad1cf90b40c9ba219dceb0282fa1dd3fdb0.tar.gz
troggle-8c4c2ad1cf90b40c9ba219dceb0282fa1dd3fdb0.tar.bz2
troggle-8c4c2ad1cf90b40c9ba219dceb0282fa1dd3fdb0.zip
Progress dots on importing data
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 83d319f..31ea102 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -125,6 +125,8 @@ def import_tunnelfiles():
#def dumplogbooks():
#def writeCaves():
+ # Writes out all cave and entrance HTML files to
+ # folder specified in settings.CAVEDESCRIPTIONS
# for cave in Cave.objects.all():
# cave.writeDataFile()
# for entrance in Entrance.objects.all():
@@ -141,8 +143,8 @@ class JobQueue():
self.results = {}
self.results_order=[
"date","runlabel","reinit", "caves", "people",
- "logbooks", "QMs", "survexblks", "survexpos",
- "tunnel", "scans", "surveyimgs", "test", "dirsredirect", "syncuser" ]
+ "logbooks", "QMs", "scans", "survexblks", "survexpos",
+ "tunnel", "surveyimgs", "test", "dirsredirect", "syncuser" ]
for k in self.results_order:
self.results[k]=[]
self.tfile = "import_profile.json"
@@ -320,6 +322,8 @@ class JobQueue():
for k in self.results_order:
if k =="dirsredirect":
break
+ if k =="surveyimgs":
+ break
elif k =="syncuser":
break
elif k =="test":
@@ -371,17 +375,15 @@ def usage():
profile - print the profile from previous runs. Import nothing.
reset - normal usage: clear database and reread everything from files - time-consuming
- caves - read in the caves
+ caves - read in the caves (must run first after reset)
+ people - read in the people from folk.csv (must run before logbooks)
logbooks - read in the logbooks
- people - read in the people from folk.csv
QMs - read in the QM csv files (older caves only)
- scans - the survey scans in all the wallets
+ scans - the survey scans in all the wallets (must run before survex)
survex - read in the survex files - all the survex blocks but not the x/y/z positions
survexpos - just the x/y/z Pos out of the survex files
- survexall - both survex and survexpos
tunnel - read in the Tunnel files - which scans the survey scans too
- drawings - Tunnel, QMs, scans
reinit - clear database (delete everything) and make empty tables. Import nothing.
syncuser - needed after reloading database from SQL backup
@@ -395,6 +397,8 @@ def usage():
caves and logbooks must be run on an empty db before the others as they
set up db tables used by the others.
+
+ the in-memory phase is on an empty db, so always runs reinit, caves & people for this phase
""")
if __name__ == "__main__":
@@ -428,8 +432,6 @@ if __name__ == "__main__":
jq.enq("people",import_people)
elif "QMs" in sys.argv:
jq.enq("QMs",import_QMs)
- elif "reinit" in sys.argv:
- jq.enq("reinit",reinit_db)
elif "reset" in sys.argv:
jq.enq("reinit",reinit_db)
jq.enq("dirsredirect",dirsredirect)
@@ -449,19 +451,14 @@ if __name__ == "__main__":
jq.enq("survexpos",import_survexpos)
elif "tunnel" in sys.argv:
jq.enq("tunnel",import_tunnelfiles)
- elif "survexall" in sys.argv:
- jq.enq("survexblks",import_survexblks)
- jq.enq("survexpos",import_survexpos)
- elif "drawings" in sys.argv:
- jq.enq("QMs",import_QMs)
- jq.enq("scans",import_surveyscans)
- jq.enq("tunnel",import_tunnelfiles)
elif "surveyimgs" in sys.argv:
jq.enq("surveyimgs",import_surveyimgs) # imports into tables which are never read
elif "autologbooks" in sys.argv: # untested in 2020
import_auto_logbooks()
elif "dumplogbooks" in sys.argv: # untested in 2020
dumplogbooks()
+# elif "writecaves" in sys.argv: # untested in 2020 - will overwrite input files!!
+# writeCaves()
elif "profile" in sys.argv:
jq.loadprofiles()
jq.showprofile()