forked from expo/troggle
Make things more compatiable with newer python
Fix the expeditions list Improvements to make it compatiable with django 1.8 Bump the years to add 2018 Update the .hgignore file to ignore junk
This commit is contained in:
@@ -42,7 +42,7 @@ def make_dirs():
|
||||
|
||||
def import_caves():
|
||||
import parsers.caves
|
||||
print "importing caves"
|
||||
print("importing caves")
|
||||
parsers.caves.readcaves()
|
||||
|
||||
def import_people():
|
||||
@@ -96,7 +96,7 @@ def reset():
|
||||
try:
|
||||
import_tunnelfiles()
|
||||
except:
|
||||
print "Tunnel files parser broken."
|
||||
print("Tunnel files parser broken.")
|
||||
|
||||
import_surveys()
|
||||
|
||||
@@ -104,11 +104,11 @@ def reset():
|
||||
def import_auto_logbooks():
|
||||
import parsers.logbooks
|
||||
import os
|
||||
for pt in core.models.PersonTrip.objects.all():
|
||||
for pt in troggle.core.models.PersonTrip.objects.all():
|
||||
pt.delete()
|
||||
for lbe in core.models.LogbookEntry.objects.all():
|
||||
for lbe in troggle.core.models.LogbookEntry.objects.all():
|
||||
lbe.delete()
|
||||
for expedition in core.models.Expedition.objects.all():
|
||||
for expedition in troggle.core.models.Expedition.objects.all():
|
||||
directory = os.path.join(settings.EXPOWEB,
|
||||
"years",
|
||||
expedition.year,
|
||||
@@ -127,10 +127,10 @@ def dumplogbooks():
|
||||
return pe.nickname
|
||||
else:
|
||||
return pe.person.first_name
|
||||
for lbe in core.models.LogbookEntry.objects.all():
|
||||
for lbe in troggle.core.models.LogbookEntry.objects.all():
|
||||
dateStr = lbe.date.strftime("%Y-%m-%d")
|
||||
directory = os.path.join(settings.EXPOWEB,
|
||||
"years",
|
||||
"years",
|
||||
lbe.expedition.year,
|
||||
"autologbook")
|
||||
if not os.path.isdir(directory):
|
||||
@@ -166,7 +166,7 @@ def writeCaves():
|
||||
entrance.writeDataFile()
|
||||
|
||||
def usage():
|
||||
print """Usage is 'python databaseReset.py <command>'
|
||||
print("""Usage is 'python databaseReset.py <command>'
|
||||
where command is:
|
||||
reset - this is normal usage, clear database and reread everything
|
||||
desc
|
||||
@@ -182,7 +182,7 @@ def usage():
|
||||
survexpos
|
||||
tunnel - read in the Tunnel files
|
||||
writeCaves
|
||||
"""
|
||||
""")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import troggle.core.models
|
||||
@@ -235,7 +235,7 @@ if __name__ == "__main__":
|
||||
elif "help" in sys.argv:
|
||||
usage()
|
||||
else:
|
||||
print "%s not recognised" % sys.argv
|
||||
print("%s not recognised" % sys.argv)
|
||||
usage()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user