summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-07 00:42:26 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-07 00:42:26 +0300
commit6d5cee7f6a22fe55a9ad322d3ba2fd5f0cdc62bd (patch)
tree561de98ddde626c2b0abd52d4f86bba66b78d6f3 /parsers/survex.py
parent6b641491311e70539de8413b29ce81a24bbbd630 (diff)
downloadtroggle-6d5cee7f6a22fe55a9ad322d3ba2fd5f0cdc62bd.tar.gz
troggle-6d5cee7f6a22fe55a9ad322d3ba2fd5f0cdc62bd.tar.bz2
troggle-6d5cee7f6a22fe55a9ad322d3ba2fd5f0cdc62bd.zip
tidy
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index f0d3057..fb2bbbc 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -2340,7 +2340,7 @@ def parse_one_file(fpath): # --------------------------------------in progress--
This all needs refactoring.
We also need to re-plumb the fileroot after importing, so that
- the new survexfile appears in the survexdirectory lists
+ the new survexfile appears in the survexdirectory lists?
"""
if svxfileroot == None:
svxfileroot = MakeFileRoot(fpath)
@@ -2368,13 +2368,10 @@ def parse_one_file(fpath): # --------------------------------------in progress--
# Now we don't need or want the dummy any more
block_dummy.delete()
-
- #svxfile.survexdirectory =
-
+
global svx_load
print(f"\n - Loading One Survex file '{fpath}'", file=sys.stderr)
svx_load = LoadingSurvex()
- #svx_load.survexdict = {}
fname = Path(settings.SURVEX_DATA, (fpath + ".svx"))
@@ -2440,15 +2437,6 @@ def parse_one_file(fpath): # --------------------------------------in progress--
#===========
parse_new_svx(fpath,svx_load)
#===========
-
- # print(f" - Number of SurvexDirectories: {len(svx_load.survexdict):,}")
- # tf = 0
- # for d in svx_load.survexdict:
- # print(f" - SD: {d}")
- # tf += len(svx_load.survexdict[d])
- # print(f" - Number of SurvexFiles: {tf:,}")
- # print(f" - Number of Survex legs: {svx_load.legsnumber:,}")
- # print(f" - Length of Survex legs: {svx_load.slength:.2f} m")
svx_load = None
return True
@@ -2460,12 +2448,6 @@ def MakeSurvexFileRoot():
fileroot = SurvexFile(path=settings.SURVEX_TOPNAME, cave=None)
fileroot.save()
- #directoryroot = SurvexDirectory(path=settings.SURVEX_DATA, primarysurvexfile=fileroot)
- # MariaDB doesn't like this hack. Complains about non-null cave_id EVEN THOUGH our model file says this is OK:
- # cave = models.ForeignKey('Cave', blank=True, null=True,on_delete=models.SET_NULL)
- #directoryroot.save()
- #fileroot.survexdirectory = directoryroot # i.e. SURVEX_DATA/SURVEX_TOPNAME
- #fileroot.save() # mutually dependent objects need a double-save like this
return fileroot