Просмотр исходного кода

/providers: sort html output by number

Helge Jung 9 лет назад
Родитель
Сommit
cdf50c1866
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      ffstatus/server.py

+ 1 - 1
ffstatus/server.py

@@ -538,7 +538,7 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
 			self.wfile.write('<!DOCTYPE html><html><head><title>BATCAVE - PROVIDERS</title></head><body>\n')
 			self.wfile.write('<table border="2"><thead><tr><th>Count</th><th>Percentage</th><th>Name</th></tr></thead><tbody>\n')
 
-			for isp in isps:
+			for isp in sorted(isps, key=lambda x: isps[isp], reverse=True):
 				self.wfile.write('<tr><td>{0}</td><td>{1:.1f}%</td><td>{2}</td></tr>\n'.format(isps[isp], isps[isp]*100.0/isps_sum, isp))
 
 			self.wfile.write('</tbody></table>\n')