[tor-commits] [metrics-tasks/master] task-6329: Properly align relays with no country in 'relays' output
karsten at torproject.org
karsten at torproject.org
Tue Jul 17 09:09:16 UTC 2012
commit 03cc7a93996d441e9faf6839fba6a64c44e38672
Author: delber <delber at riseup.net>
Date: Mon Jul 16 15:23:33 2012 +0000
task-6329: Properly align relays with no country in 'relays' output
---
task-6329/tor-relays-stats.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/task-6329/tor-relays-stats.py b/task-6329/tor-relays-stats.py
index 7efd623..d876c76 100755
--- a/task-6329/tor-relays-stats.py
+++ b/task-6329/tor-relays-stats.py
@@ -109,7 +109,7 @@ class RelayStats(object):
selection_consensus_weight = 0
for relay in ranking[:count]:
selection_consensus_weight += relay['consensus_weight']
- print "%8.4f%% %-19s %-2s %-4s %-5s %s %-7s %s" % (relay['consensus_weight'] * 100.0 / total_consensus_weight, relay['nickname'], relay['fingerprint'], 'Exit' if 'Exit' in set(relay['flags']) else '', 'Guard' if 'Guard' in set(relay['flags']) else '', relay.get('country', ''), relay.get('as_number', ''), relay.get('as_name', ''))
+ print "%8.4f%% %-19s %-2s %-4s %-5s %s %-7s %s" % (relay['consensus_weight'] * 100.0 / total_consensus_weight, relay['nickname'], relay['fingerprint'], 'Exit' if 'Exit' in set(relay['flags']) else '', 'Guard' if 'Guard' in set(relay['flags']) else '', relay.get('country', ' '), relay.get('as_number', ''), relay.get('as_name', ''))
if len(ranking) > count:
other_consensus_weight = 0
for relay in ranking[count:]:
More information about the tor-commits
mailing list