2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-01-18 17:02:31 +00:00

type data added to report

This commit is contained in:
Philip Sargent 2021-03-24 21:16:06 +00:00
parent 2fe2c0515f
commit 65be64c756
2 changed files with 54 additions and 12 deletions

View File

@ -53,29 +53,65 @@ def pathsreport(request):
"URL_ROOT" : str( settings.URL_ROOT)
}
except:
pathsdict["! EXCEPTION !"] = "missing string constant in troggle/settings"
pathsdict["! EXCEPTION !"] = "missing or exta string constant in troggle/settings"
pathstype = OrderedDict()
try:
pathstype = {
# "BOGUS" : type(settings.BOGUS),
"JSLIB_URL" : type(settings.JSLIB_URL),
# "CSSLIB_URL" : type(settings.CSSLIB_URL),
"CAVEDESCRIPTIONS" : type(settings.CAVEDESCRIPTIONS),
"DIR_ROOT" : type(settings.DIR_ROOT),
"ENTRANCEDESCRIPTIONS" : type(settings.ENTRANCEDESCRIPTIONS),
"EXPOUSER_EMAIL" : type(settings.EXPOUSER_EMAIL),
"EXPOUSERPASS" : type(settings.EXPOUSERPASS),
"EXPOUSER" : type(settings.EXPOUSER),
"EXPOWEB" : type(settings.EXPOWEB),
"EXPOWEB_URL" : type(settings.EXPOWEB_URL),
"FILES" : type(settings.FILES),
"LOGFILE" : type(settings.LOGFILE),
"LOGIN_REDIRECT_URL" : type(settings.LOGIN_REDIRECT_URL),
"MEDIA_ROOT" : type(settings.MEDIA_ROOT),
"MEDIA_URL" : type(settings.MEDIA_URL),
"PHOTOS_URL" : type(settings.PHOTOS_URL),
"PYTHON_PATH" : type(settings.PYTHON_PATH),
"REPOS_ROOT_PATH" : type(settings.REPOS_ROOT_PATH),
"ROOT_URLCONF" : type(settings.ROOT_URLCONF),
"STATIC_URL" : type(settings.STATIC_URL),
"SURVEX_DATA" : type(settings.SURVEX_DATA),
"SURVEY_SCANS" : type(settings.SURVEY_SCANS),
"SURVEYS" : type(settings.SURVEYS),
"SURVEYS_URL" : type(settings.SURVEYS_URL),
"SURVEXPORT" : type(settings.SURVEXPORT),
"THREEDCACHEDIR" : type(settings.THREEDCACHEDIR),
"TUNNEL_DATA" : type(settings.TUNNEL_DATA),
"URL_ROOT" : type(settings.URL_ROOT)
}
except:
pathstype["! EXCEPTION !"] = "missing or exta string constant in troggle/settings"
# settings are unique by paths are not
ncodes = len(pathsdict)
bycodeslist = sorted(pathsdict.items()) # a list of tuples
bypaths = sorted(pathsdict.values()) # a list
bycodeslist2 = []
for k, p in bycodeslist:
bycodeslist2.append((k, p, str(pathstype[k])))
bypaths = sorted(pathsdict.values()) # a list
bypathslist = []
for p in bypaths:
for k in pathsdict.keys():
if pathsdict[k] == p:
bypathslist.append((p, k))
bypathslist.append((p, k, str(pathstype[k])))
del pathsdict[k]
break
#bypaths = sorted(bycodeslist, key=bycodeslist[1])
# iterate through the dictionary and append each tuple into the temporary list
#f#=or w in bypaths:
# bypathslist[w] = pathsdict[w]
return render(request, 'pathsreport.html', {
"pathsdict":pathsdict,
"bycodeslist":bycodeslist,
"bycodeslist":bycodeslist2,
"bypathslist":bypathslist,
"ncodes":ncodes})

View File

@ -12,8 +12,8 @@
<p>
<table style="font-family: Consolas, Lucida Console, monospace;">
<tr><th>Code</th><th>Path</th></tr>
{% for c,p in bycodeslist %}
<tr><th>Code</th><th>Path</th><th>Type</th></tr>
{% for c,p,t in bycodeslist %}
<tr>
<td>
{{c}}
@ -21,14 +21,17 @@
<td>
{{p}}
</td>
<td>
{{t}}
</td>
</tr>
{% endfor %}
</table>
<p>
<table style="font-family: Consolas, Lucida Console, monospace;">
<tr><th>Path</th><th>Code</th></tr>
{% for c,p in bypathslist %}
<tr><th>Path</th><th>Code</th><th>Type</th></tr>
{% for c,p,t in bypathslist %}
<tr>
<td>
{{p}}
@ -36,6 +39,9 @@
<td>
{{c}}
</td>
<td>
{{t}}
</td>
</tr>
{% endfor %}
</table>