summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip@Muscogee.localdomain>2020-05-20 12:45:10 +0100
committerPhilip Sargent <philip@Muscogee.localdomain>2020-05-20 12:45:10 +0100
commit819eca5deae9d8fae6b2111fca9195e04cd68697 (patch)
tree32661fa68f147e11f1dcaa4f3e615273b8cb3d84 /databaseReset.py
parentedbe793c6815d64504b9418a8cf2612c5ad5e3b1 (diff)
downloadtroggle-819eca5deae9d8fae6b2111fca9195e04cd68697.tar.gz
troggle-819eca5deae9d8fae6b2111fca9195e04cd68697.tar.bz2
troggle-819eca5deae9d8fae6b2111fca9195e04cd68697.zip
cleaning options list
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/databaseReset.py b/databaseReset.py
index d8bc926..fc12dde 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -346,26 +346,27 @@ class JobQueue():
def usage():
print("""Usage is 'python databaseReset.py <command> [runlabel]'
where command is:
+ test - testing... imports people and prints profile. Deletes nothing.
+ 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
logbooks - read in the logbooks
people - read in the people from folk.csv
QMs - read in the QM csv files (older caves only)
- reinit - clear database (delete everything) and make empty tables. Import nothing.
scans - the survey scans in all the wallets
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
- profile - print the profile from previous runs. Import nothing.
+ drawings - Tunnel, QMs, scans
- resetend - (archaic?)
- writecaves - *disabled* (archaic?)
- autologbooks - read in autologbooks (what are these?)
- dumplogbooks - write out autologbooks (not working?)
+ reinit - clear database (delete everything) and make empty tables. Import nothing.
syncuser - needed after reloading database from SQL backup
- surveyimgs - read in scans by expo, must run after "people". Not used.
- test - testing...
+ autologbooks - Not used. read in autologbooks (what are these?)
+ dumplogbooks - Not used. write out autologbooks (not working?)
+ surveyimgs - Not used. read in scans by-expo, must run after "people".
and [runlabel] is an optional string identifying this run of the script
in the stored profiling data 'import-profile.json'
@@ -392,11 +393,8 @@ if __name__ == "__main__":
usage()
exit()
elif "test" in sys.argv:
- jq.enq("reinit",reinit_db)
- jq.enq("dirsredirect",dirsredirect)
jq.enq("caves",import_caves)
jq.enq("people",import_people)
- jq.enq("scans",import_surveyscans)
elif "caves" in sys.argv:
jq.enq("caves",import_caves)
elif "logbooks" in sys.argv:
@@ -422,25 +420,28 @@ if __name__ == "__main__":
jq.enq("scans",import_surveyscans)
elif "survex" in sys.argv:
jq.enq("survexblks",import_survexblks)
- jq.enq("survexpos",import_survexpos)
elif "survexpos" in sys.argv:
jq.enq("survexpos",import_survexpos)
- elif "surveyimgs" in sys.argv:
- jq.enq("surveyimgs",import_surveyimgs)
elif "tunnel" in sys.argv:
jq.enq("tunnel",import_tunnelfiles)
- elif "help" in sys.argv:
- usage()
- elif "resetend" in sys.argv:
+ 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)
- jq.enq("surveyimgs",import_surveyimgs)
+ 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 "profile" in sys.argv:
jq.showprofile()
+ elif "help" in sys.argv:
+ usage()
+ exit()
else:
usage()
print("%s not recognised as a command." % sys.argv[1])