reverse ordering

master
Ubuntu 2016-12-23 05:06:47 -05:00
parent 843bae8fa0
commit 92e1298b00
3 changed files with 5 additions and 4 deletions

Binary file not shown.

View File

@ -16,7 +16,8 @@ def show_entries():
for i in range(len(files)): for i in range(len(files)):
files[i] = files[i].replace('.txt', '') files[i] = files[i].replace('.txt', '')
files[i] = int(files[i]) files[i] = int(files[i])
files.sort()
files.sort(reverse=True)
for i in range(len(files)): for i in range(len(files)):
files[i] = ''.join([str(files[i]), '.txt']) files[i] = ''.join([str(files[i]), '.txt'])
@ -32,7 +33,7 @@ def show_entries():
line = line.replace('<', '&lt;') line = line.replace('<', '&lt;')
line = line.replace('>', '&gt;') line = line.replace('>', '&gt;')
return render_template('show_entries.html', entries=files_contents, i=range(len(files_contents))) return render_template('show_entries.html', length=len(files_contents), entries=files_contents, i=range(len(files_contents)))
if __name__ == "__main__": if __name__ == "__main__":
app.run() app.run()

View File

@ -2,8 +2,8 @@
<title>vtbash</title> <title>vtbash</title>
{% block body %} {% block body %}
{% for j in i %} {% for j in i %}
<p style="background-color: rgba(255,102,0,.2);"> <p id="{{ j + 1}}" style="background-color: rgba(255,102,0,.2);">
#{{ j + 1 }}<br> #{{ length - j }}<br>
{% for line in entries[j] %} {% for line in entries[j] %}
{{ line }}<br> {{ line }}<br>
{% endfor %} {% endfor %}