2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 16:51:54 +00:00

Add help command and usage info to databaseReset.py

This commit is contained in:
wookey 2013-06-24 01:31:14 +01:00
parent 99ea6778ad
commit ea9266ecf9

View File

@ -161,7 +161,23 @@ def writeCaves():
cave.writeDataFile() cave.writeDataFile()
for entrance in Entrance.objects.all(): for entrance in Entrance.objects.all():
entrance.writeDataFile() entrance.writeDataFile()
def usage():
print """Usage is 'python databaseReset.py <command>'
where command is:
reset - this is normal usage, clear database and reread everything
desc
logbooks - read in the logbooks
autologbooks
dumplogbooks
QMs - read in the QM files
resetend
scans - reaq in the scanned surveynotes
survex - read in the survex files
survexpos
tunnel - read in the Tunnel files
writeCaves
"""
if __name__ == "__main__": if __name__ == "__main__":
import core.models import core.models
@ -207,8 +223,11 @@ if __name__ == "__main__":
dumplogbooks() dumplogbooks()
elif "writeCaves" in sys.argv: elif "writeCaves" in sys.argv:
writeCaves() writeCaves()
elif "help" in sys.argv:
usage()
else: else:
print "Do 'python databaseReset.py reset'" print "%s not recognised" % sys.argv
usage()