diff --git a/Src/network-broker/network-broker b/Src/network-broker/network-broker index 02b797c..3416af0 100755 --- a/Src/network-broker/network-broker +++ b/Src/network-broker/network-broker @@ -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) diff --git a/Src/network-broker/stats.py b/Src/network-broker/stats.py index 2dc7d43..831a583 100644 --- a/Src/network-broker/stats.py +++ b/Src/network-broker/stats.py @@ -59,8 +59,13 @@ class HtmlGenerator: outf.write("

\n") outf.write("\n") count = 1 - for country, num in sorted_countries: - outf.write("\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("\n" % + (count, c1, n1, count + n_countries / 2, c2, n2) ) count = count + 1 outf.write("

Country list

%3d %s (%d)
%3d %s (%d)   %3d %s (%d)
\n") outf.write("\n")