mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 02:07:07 +00:00
SurvexBlocks now importing in deatil
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
import time
|
||||
import timeit
|
||||
import json
|
||||
import resource
|
||||
|
||||
import settings
|
||||
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
|
||||
@@ -11,13 +12,13 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
|
||||
print(" - settings on loading databaseReset.py")
|
||||
|
||||
import django
|
||||
print(" - django.setup - next")
|
||||
print(" - Memory footprint before loading Django: {:.3f} MB".format(resource.getrusage(resource.RUSAGE_SELF)[2]/1024.0))
|
||||
try:
|
||||
django.setup()
|
||||
except:
|
||||
print(" ! Cyclic reference failure. Can occur when the initial db is empty. Fixed now (in UploadFileForm) but easy to reintroduce..")
|
||||
raise
|
||||
print(" - django.setup - done")
|
||||
print(" - Memory footprint after loading Django: {:.3f} MB".format(resource.getrusage(resource.RUSAGE_SELF)[2]/1024.0))
|
||||
|
||||
import troggle.flatpages.models
|
||||
import troggle.core.models
|
||||
@@ -194,7 +195,7 @@ class JobQueue():
|
||||
memend = get_process_memory()
|
||||
duration = time.time()-start
|
||||
#print(" - MEMORY start:{:.3f} MB end:{:.3f} MB change={:.3f} MB".format(memstart,memend, ))
|
||||
print("\n*- Ended \"", runfunction[0], "\" {:.1f} seconds + {:.3f} MB".format(duration, memend-memstart))
|
||||
print("\n*- Ended \"", runfunction[0], "\" {:.1f} seconds + {:.3f} MB ({:.3f} MB)".format(duration, memend-memstart, memend))
|
||||
self.results[runfunction[0]].pop() # the null item
|
||||
self.results[runfunction[0]].append(duration)
|
||||
|
||||
@@ -307,7 +308,7 @@ if __name__ == "__main__":
|
||||
runlabel = sys.argv[len(sys.argv)-1]
|
||||
else:
|
||||
runlabel=None
|
||||
|
||||
|
||||
jq = JobQueue(runlabel)
|
||||
|
||||
if len(sys.argv)==1:
|
||||
|
||||
Reference in New Issue
Block a user