mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 06:57:12 +00:00
tidy
This commit is contained in:
@@ -27,19 +27,14 @@ from troggle.parsers.survex import parse_one_file
|
||||
but also displays data on a cave or caves when there is ambiguity
|
||||
"""
|
||||
|
||||
todo = """- survexcavesingle is not properly producing any result for Homecoming, 1626-359, 2018-dm-07
|
||||
even though there are dozens of surveys.
|
||||
|
||||
todo = """
|
||||
- filter out the non-public caves from display UNLESS LOGGED IN
|
||||
|
||||
- Never actual uses the object for the survexfile, works entirely from the filepath! Make it check and validate
|
||||
|
||||
- the primary survex file in each cave directory should be in a configuration? not buried in the code
|
||||
and implicit in the order of *import statements ?
|
||||
and implicit in the order of *import statements ? It is in the cave_data file.
|
||||
|
||||
- Save and re-parse an edited survexfile which already exists in the db, and update
|
||||
all its dependencies (work in progress)
|
||||
|
||||
- overlapping and cross-calling when things fail make this hard to undersand, e.g. svx() and
|
||||
survexcavessingle() can get called for a survex file depending on whether the URL ends in ".svx" or not,
|
||||
but each tries to handle the other case too.
|
||||
@@ -648,23 +643,9 @@ def survexcaveslist(request):
|
||||
)
|
||||
|
||||
def survexdir(request):
|
||||
"""report on all the SurvexDirectory objects
|
||||
We are trying to find out how mismatches have crept in.
|
||||
and whether the whole SurvexDirectory class is actually redundant
|
||||
as the info it holds is always embedded in the survexFile path directories
|
||||
"""report on all the primary survex files, per cave and per directory
|
||||
"""
|
||||
|
||||
# sds = SurvexDirectory.objects.all() #.order_by("cave")
|
||||
sds ={}
|
||||
# for sd in sds:
|
||||
# sd.matchbad = True
|
||||
# if f"{sd.primarysurvexfile}".startswith(str(sd.path)):
|
||||
# sd.matchbad = False
|
||||
|
||||
# sd.pathbad = True
|
||||
# if Path(settings.SURVEX_DATA, f"{sd.primarysurvexfile}.svx").is_file():
|
||||
# sd.pathbad = False
|
||||
|
||||
|
||||
survexfiles = SurvexFile.objects.all().order_by("cave")
|
||||
for f in survexfiles:
|
||||
f.pathbad = True
|
||||
@@ -692,11 +673,6 @@ def survexcavesingle(request, cave_shortname):
|
||||
cave.sds = get_primaries(cave)
|
||||
return render(request, "svxcaves.html", {"settings": settings, "caves": [cave]})
|
||||
else:
|
||||
# not a cave or an ambiguous short name, e.g. "122"
|
||||
|
||||
# if (SVXPATH / Path(cave_shortname + ".svx")).is_file():
|
||||
# return svx(request, cave_shortname)
|
||||
|
||||
caves = Cave.objects.filter(kataster_number=cave_shortname)
|
||||
if len(caves) > 0:
|
||||
# print(f"many {cave_shortname=} => {caves=}")
|
||||
|
||||
Reference in New Issue
Block a user