mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-16 20:39:15 +01:00
Keep countries in two columns
This commit is contained in:
parent
e83e24f785
commit
5deb489b18
@ -382,7 +382,11 @@ class Broker(SocketServer.UDPServer):
|
||||
self.image_dir = image_dir
|
||||
|
||||
stats.load(self.stat_data)
|
||||
stats.generate_html(self.stat_html)
|
||||
try:
|
||||
stats.generate_html(self.stat_html)
|
||||
except:
|
||||
# Don't care if it fails
|
||||
pass
|
||||
|
||||
def log_connection(self, who, country):
|
||||
stats.add_connection(who, country)
|
||||
|
@ -59,8 +59,13 @@ class HtmlGenerator:
|
||||
outf.write("<br><br><TABLE border=\"0\" cellpadding=\"0\">\n")
|
||||
outf.write("<TR><TD colspan=4><H3>Country list</H3></TD></TR>\n")
|
||||
count = 1
|
||||
for country, num in sorted_countries:
|
||||
outf.write("<TR><TD><b>%3d</b></TD><TD> </TD><TD>%s (%d)</TD></TR>\n" % (count, country, num) )
|
||||
|
||||
n_countries = len(sorted_countries)
|
||||
for i in range(0, n_countries / 2):
|
||||
c1, n1 = sorted_countries[i]
|
||||
c2, n2 = sorted_countries[i + n_countries / 2]
|
||||
outf.write("<TR><TD><b>%3d</b></TD><TD> </TD><TD>%s (%d)</TD><TD> </TD><TD> </TD><TD> </TD><TD><b>%3d</b></TD><TD> </TD><TD>%s (%d)</TD></TR>\n" %
|
||||
(count, c1, n1, count + n_countries / 2, c2, n2) )
|
||||
count = count + 1
|
||||
outf.write("</TABLE>\n")
|
||||
outf.write("</body></html>\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user