docum updates

This commit is contained in:
Philip Sargent 2021-10-31 22:48:05 +02:00
parent a73c666415
commit a757b7d205
3 changed files with 61 additions and 52 deletions

View File

@ -46,15 +46,17 @@ body {
<li><!--2020-03-26 psargent-->Explain how to link a new cave into the other caves in
troggle filesystem
<li><!--2020-03-26 psargent-->Explain how to add photos with the correct URL format to sub-HTML files attached to New Caves
<li>explain how to put stuff in the wallet folder and how to look at expofiles/photos/xml/
</details>
<details><summary><!--2021-10-31 psargent-->Scans and Drawings Uploads</summary>
<li>Add to user data manual how to upload to expofiles - in the "survey manual"
<li>Add in description of *where* to put the drawings files
</details>
<details><summary><!--2020-04-13 psargent-->svx check</summary>
<li>explain command line to run on newly typed survex file to check for format errors '$cavern xxxx.svx'
<li>explain when to use svxtrace.py <a href="troggle/scriptscurrent.html">current scripts</a>
<li>Making an svx - explain how to make link to *ref to wallet folder
<li>explain how to put stuff in the wallet folder and how to look at expofiles/photos/xml/
<li>Add to user data manual how to upload to expofiles - in the "survey manual"
<li>Add in description of *where* to put the drawings files
</details>
<h3>Wallets re-programming</h3>
<details><summary><!--2021-05-21 psargent-->Things wallets.py might do in future </summary>
@ -102,10 +104,7 @@ body {
<details><summary>Areas (these are the sub-areas)</summary>
<li><!--2020-05-01 psargent-->Downgrade the "areas" aspect of the documentation as we don't use these now
</details>
<details><summary>Prospecting Guides & slippy map & GPS tracks</summary>
<li><!--2020-07-24 psargent-->Redesign to be used as overlay on phone/tablet using essentials.gpx data
</details>
<h3>Photos</h3>
<details><summary><!--2020-04-03 psargent-->Fix the BINS package (Wookey is looking for replacement)</summary>
@ -154,9 +153,7 @@ body {
<li>Be exhaustive in checking all the broken links between svx & wallets
</details>
<details><summary>non-troggle scripts </summary>
<li><!--2020-04-03 psargent-->DOCUMENT them all - have we got ? //expofiles/unidentified_scripts/ !
</details>
<details><summary>Makefile</summary>
<li>Get it working ! How many of <a href="../troggle/scriptsother.html">other scripts</a> should be in it ? Should we do data imports to schedule too ?
@ -164,6 +161,13 @@ body {
</details>
<h3>Troggle</h3>
<details><summary><!--2021-10-31 psargent--> admin links to fix password/username ALL BROKEN</summary>
<li>Links on http://localhost:8000/accounts/login/ lead to 404s
</details>
http://localhost:8000/accounts/login/
<details><summary><!--2020-07-27 psargent--> QM links in cave descriptions ALL BROKEN</summary>
<li><!--2020-07-24 psargent-->There are HREF links to individual QMs in the cave description in e.g. 204
<a href="1623/204/swings.html">Swings and Roundabouts</a> such as "At the bottom there is a climb down over boulders <a href="1623/204/qm.html#C2001-204-45">[C2001-204-45 C]</a>." where the troggle URL fails completely.
@ -202,11 +206,7 @@ body {
<details><summary><!--2020-07-24 psargent--> document cgit installation and config</summary>
<li><!--2020-07-24 psargent-->as per Wookey on new server Debian 10
</details>
<details><summary><!--2020-03-26 psargent--> document directory structure</summary>
<li><!--2020-04-03 psargent-->as per Julian's GitHub list - then close that issue.
Use 'tee' to create ascii art for this.
</details>
<details><summary>permissions</summary>
<li><!--2020-04-03 psargent-->do we need a cron job or has the group membership fix fixed it ? either way, document it.
<li><!--2020-04-03 psargent-->Makefile - and permissions.

View File

@ -17,21 +17,24 @@ The python stand-alone script <var>databaseRest.py</var> imports data from files
Usage is 'python databaseReset.py &lt;command&gt; [runlabel]'
where command is:
reset - normal usage: clear database and reread everything from files - time-consuming
caves - read in the caves
logbooks - read in the logbooks
people - read in the people from folk.csv
QMs - read in the QM csv files (older caves only)
reinit - clear database (delete everything) and make empty tables. Import nothing.
scans - the survey scans in all the wallets
survex - read in the survex files - all the survex blocks but not the x/y/z positions
survexpos - just the x/y/z Pos out of the survex files
tunnel - read in the Tunnel files - which scans the survey scans too
test - testing... imports people and prints profile. Deletes nothing.
profile - print the profile from previous runs. Import nothing.
- del - deletes last entry
- delfirst - deletes first entry
reset - normal usage: clear database and reread everything from files - time-consuming
init - clear database (delete everything) and make empty tables. Import nothing.
caves - read in the caves
people - read in the people from folk.csv
logbooks - read in the logbooks
QMs - read in the QM csv files (older caves only)
scans - the survey scans in all the wallets
drawings - read in the Tunnel & Therion files - which scans the survey scans too
survex - read in the survex files - all the survex blocks and entrances x/y/z
test - testing...
dumplogbooks - Not used. write out autologbooks (not working?)
and [runlabel] is an optional string identifying this run of the script
in the stored profiling data 'import-profile.json'

View File

@ -309,42 +309,48 @@ explains what this does and gives extra command line options.
<p>Now run the test suite:
<pre><code>python manage.py test -v 3 --traceback</code></pre>
<p>This will run the entire troggle test suite of over 70 tests (it takes only a few seconds).</code></pre>
<p>This will run the entire troggle test suite of over 70 tests (it takes only a few seconds).
<pre>
If you get an error, and you probably will, have a look in the test file, e.g. for this error:
FAIL: test_page_folk (troggle.core.TESTS.tests.PageTests)
look in the file troggle/code/TESTS/tests.py in the class PageTests.
<p>
If you get an error, and you probably will, have a look in the source code of the test, e.g. for this error:
<pre><code>FAIL: test_page_folk (troggle.core.TESTS.tests.PageTests) </code></pre>
look in the file
<var>troggle/code/TESTS/tests.py</var> in the class <var>PageTests</var>.
It will also say:
File "/mnt/c/EXPO/troggle/core/TESTS/tests.py", line 266, in test_page_folk
which means that the asssert failure in on line 266 of troggle/code/TESTS/tests.py
and that the failure function is test_page_folk()
<pre><code> File "/mnt/c/EXPO/troggle/core/TESTS/tests.py", line 266, in test_page_folk</code></pre>
which means that the asssert failure in on line 266 of <var>troggle/code/TESTS/tests.py</var>
and that the failure function is test_page_folk() .
If you look at this you will see that line 264 is:
response = self.client.get('/folk/index.htm')
<pre><code> response = self.client.get('/folk/index.htm')</code></pre>
so this file is missing. Duh. Of course it is. We downloaded troggle from git but we didn't run
the standalone script to generate the folk list. It is top of the list in
http://expo.survex.com/handbook/troggle/scriptscurrent.html#folk
the standalone script to generate the folk list.
The quickest thing to do when installing troggle is to simply download a copy from the server:
<pre><code> wget -O ../expoweb/folk/index.htm expo.survex.com/folk/index.htm</code></pre>
and run the tests again:
<pre><code>python manage.py test -v 2</code></pre>
<details><summary>Click on the triangle to see how to run the <var>folk</var> script.</summary>
<font color="blue">
The <var>folk</var> generation script is top of the list in
<var>
http://expo.survex.com/handbook/troggle/scriptscurrent.html#folk</var>
<p>
So do this:
<pre>
cd ../expoweb/folk
python ../scripts/make-folklist.py <folk.csv >index.htm
cd ../../troggle
Or just sFTP a copy from expo.survex.com
and run the tests again:
python manage.py test -v 2
Yeah if you were paying attention, you will see that this has done a git commit for a test file
in the drawings repo locally.
Sorry about that. the test harness does not yet undo that. So you will need ot manually reverse that commit: go into your favourite git tool. In VS code the command is Commit: Undo last commit
If you have run the test suite several times you will need to undo several commits (and delete the files producd by the test suite).
</pre>
<p>The test suite has over 70 tests but does not cover all of what troggle does and does not use any real data. You need to manually test these too, after you have done a full data import:
</font>
</details>
<p>The test suite now tidies up after itself, so there should not be any temporary files left behind or local git commits that you will need to clean up.
<p>The test suite has over 70 tests but does not cover all of what troggle does and does not use any real data. You need to manually test these too, <em>after</em> you have done a full <a href="trogimport.html">data import</a>:
<br>- <var><a href="http://localhost:8000/pathsreport">http://localhost:8000/pathsreport</a></var>
<br>- <var><a href="http://localhost:8000/stats">http://localhost:8000/stats</a></var>
<br>- <var><a href="http://localhost:8000/people">http://localhost:8000/people</a></var> (takes a minute or so)