summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2019-04-17 22:29:56 -0300
committerSoniEx2 <endermoneymod@gmail.com>2019-04-17 22:29:56 -0300
commitc38c2d321cd78828d9eb86a5b70c0197135a721a (patch)
treeff8aaef8a047a6e4102a2a7bb3e4c80f8a61ae8a
parentd5e011d3ea0501c22f3a6fd0d7e1af4313cf0366 (diff)
Fix display/sort order
-rwxr-xr-xganarchy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ganarchy.py b/ganarchy.py
index a25d9dc..90e72c7 100755
--- a/ganarchy.py
+++ b/ganarchy.py
@@ -201,11 +201,12 @@ def cron_target():
         if result is not None:
             count, post_hash, msg = result
             entries.append((url, count, post_hash))
-            generate_html.append((url, msg))
+            generate_html.append((url, msg, count))
     c.executemany('''INSERT INTO repo_history VALUES (NULL, ?, ?, ?)''', entries)
     conn.commit()
+    generate_html.sort(key=lambda x: x[2])  # sort by count
     html_entries = []
-    for (url, msg) in generate_html:
+    for (url, msg, count) in generate_html:
         history = c.execute('''SELECT count FROM repo_history WHERE url == ? ORDER BY entry ASC''', (url,)).fetchall()
         # TODO process history into SVG
         html_entries.append((url, msg, ""))