Changeset - 60636de1c5f5
[Not reviewed]
feature-cli
0 1 0
Dennis Fink - 9 years ago 2015-10-26 22:52:04
dennis.fink@c3l.lu
Fix total message in countries subcommand
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
ennstatus/cli/commands/stats.py
Show inline comments
 
@@ -111,30 +111,30 @@ def countries(obj, by_type):
 
        for key, value in servers.items():
 
            for server in value:
 
                countries[server.country] += 1
 

	
 
        for key, value in sorted(countries.items(), key=lambda x: x[1]):
 
            click.echo(
 
                '%s: %s' % (
 
                    click.style(key, fg='green'),
 
                    click.style(str(value), fg='blue')
 
                )
 
            )
 

	
 
            click.echo(
 
                'We are hosted in %s different countries' % click.style(
 
                    str(len(countries.keys())),
 
                    fg='blue'
 
                )
 
        click.echo(
 
            'We are hosted in %s different countries' % click.style(
 
                str(len(countries.keys())),
 
                fg='blue'
 
            )
 
        )
 
    else:
 
        type_countries = {
 
            'exit': defaultdict(int),
 
            'relay': defaultdict(int),
 
            'bridge': defaultdict(int)
 
        }
 

	
 
        for key, value in servers.items():
 
            for server in value:
 
                type_countries[key][server.country] += 1
 

	
 
        type_countries = dict((k, v) for k, v in type_countries.items() if v)
0 comments (0 inline, 0 general)