2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 06:07:16 +00:00

More diagnostics

This commit is contained in:
2025-01-31 00:37:20 +00:00
parent 6d5c6c0d0b
commit e080610010
2 changed files with 37 additions and 8 deletions

View File

@@ -31,9 +31,9 @@ def kataster(request, slug):
return HttpResponseRedirect("/caves")
knum = 9999
cavename = str(cave) + ".html"
filename = str(cave) + ".html"
cave_data = Path( "cave_data", cavename )
cave_data = Path( "cave_data", filename )
if not (settings.EXPOWEB / cave_data).is_file:
cave_data = "does not exist"
@@ -45,6 +45,15 @@ def kataster(request, slug):
print(ent.name)
entrance_data.append("entrance_data/"+ent.name)
loser_name = f"caves-{str(cave.areacode)}/{str(cave.unofficial_number)}"
loser_dir = settings.SURVEX_DATA / loser_name
loser_data = []
if (loser_dir).is_dir():
print(loser_dir)
for svx in loser_dir.iterdir():
print(svx)
loser_data.append(Path(loser_dir , svx).name)
if request.method == "POST": # If the form has been submitted...
form = KatasterForm(request.POST) # A form bound to the POST data
if form.is_valid():
@@ -61,6 +70,7 @@ def kataster(request, slug):
"form": form,
"cave": cave,
"cave_data": cave_data, "entrance_data": entrance_data,
"loser_name": loser_name, "loser_data": loser_data,
"knum": knum,
}, )

View File

@@ -27,7 +27,7 @@ This cave needs to be "katastered". If you have the new number issued by the Aus
</form>
{% endif %}
<h3>Rename the .html files</h3>
<h3>Rename the .html files in <var>expoweb</var></h3>
<div style="font-family: monospace; font-weight: bold;">
{{cave_data|safe}}
<p>
@@ -43,13 +43,21 @@ This cave needs to be "katastered". If you have the new number issued by the Aus
<li> Rename all the files listed above - always do this <b>last</b> otherwise it is hard to automatically discover which edits have not been done.
</ul>
<h3>Rename the cave description directory</h3>
<h3>Rename the cave description directory in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Edit all the '<samp>href=</samp>' <small>URLS</small> (if they exist) inside all the <samp>cave_data</samp> and <samp>entrance_data</samp> files descriptive text to refer to the new directory
<li> Rename the directory (if it exists) inside the areacode directory, e.g. rename <samp>/{{cave.areacode}}/{{cave.unofficial_number}}/</samp> as <samp>/{{cave.areacode}}/{{knum}}/</samp> (if {{knum}} is the correct new kataster number). Do this last.
</ul>
<h3>Rename the survex directory</h3>
<h3>Rename the survex directory in <var>loser</var></h3>
<div style="font-family: monospace; font-weight: bold;">
{{loser_name|safe}}/
<p>
{% for f in loser_data %}
&nbsp;&nbsp;&nbsp;{{f|safe}}</br />
{% endfor %}
</div>
<ul style="list-style: disc">
<li> Find the survex files for this cave and edit the <samp>*include</samp> inside the survex files to use the new kataster number
<li> find and edit the '*_station' tags in each entrance_data file and in the fixed points files in the loser repo.
@@ -58,10 +66,18 @@ This cave needs to be "katastered". If you have the new number issued by the Aus
<li> Run <samp>'cavern caves-{{cave.areacode |safe}}/caves.svx' </samp> and check it all works as you hope
</ul>
<h3>Set the historic alias forwarder</h3>
<h3>Sort out the *fix point(s) in both <var>loser</var> and in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Find the *fix point for each entrance (one or more in each <samp>entrance_data</samp> file) in <var>expoweb</var>
<li> Change the name of each *fix point in the relevant survex file in <var>loser</var>
<li> Make the same name change(s) in each entrance file (in each <samp>entrance_data</samp> file) in <var>expoweb</var>
</ul>
<h3>Set the historic alias forwarder in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Add the line <br /><samp>("{{cave.slug|safe}}", "{{cave.areacode |safe}}-{{knum}}"),</samp></br /> to the end
of the file <var><a href="/cave_data/cavealiases.txt_edit">cave_data/cavealiases.txt</a></var> (don't forget the final comma)
of the file <var><a href="/cave_data/cavealiases.txt_edit">cave_data/cavealiases.txt</a></var> (don't forget the comma at the end of the line)
</ul>
<h3>Finally</h3>
<ul style="list-style: disc">
@@ -83,4 +99,7 @@ git push<br />
(in fact, look at this before you do any of this, so you can see what chnages.)
</ul>
<h3>Ideal scenario</h3>
<p>
<p>Ideally you do this renumbering on a standalone instance of troggle running on a <var> &#9874; <a href="/handbook/troggle/troglaptop.html">troggle development laptop</a></var> and you don't push any of the git commits to the server until you have got all the niggles out of the conversion, i.e. the databaseReset runs locally without any warnings or errors introduced by your renaming <em>and</em> 'cavern' runs without any new survex errors.
{% endblock %}