Fix display/sort order
This commit is contained in:
		
							parent
							
								
									d5e011d3ea
								
							
						
					
					
						commit
						c38c2d321c
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -201,11 +201,12 @@ def cron_target():
 | 
				
			||||||
        if result is not None:
 | 
					        if result is not None:
 | 
				
			||||||
            count, post_hash, msg = result
 | 
					            count, post_hash, msg = result
 | 
				
			||||||
            entries.append((url, count, post_hash))
 | 
					            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)
 | 
					    c.executemany('''INSERT INTO repo_history VALUES (NULL, ?, ?, ?)''', entries)
 | 
				
			||||||
    conn.commit()
 | 
					    conn.commit()
 | 
				
			||||||
 | 
					    generate_html.sort(key=lambda x: x[2])  # sort by count
 | 
				
			||||||
    html_entries = []
 | 
					    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()
 | 
					        history = c.execute('''SELECT count FROM repo_history WHERE url == ? ORDER BY entry ASC''', (url,)).fetchall()
 | 
				
			||||||
        # TODO process history into SVG
 | 
					        # TODO process history into SVG
 | 
				
			||||||
        html_entries.append((url, msg, ""))
 | 
					        html_entries.append((url, msg, ""))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue