[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [compass/master] Display total count in fingerprint column
commit 100d6441449208988869be94d810ed590d479b15
Author: Sathyanarayanan Gunasekaran <gsathya.ceg@xxxxxxxxx>
Date: Tue Aug 28 19:14:05 2012 +0530
Display total count in fingerprint column
When grouping by country/AS, the total number of relays
are displayed in the nickname column. This is wrong, we
calculate the number of unique fingerprints and not
nicknames. Move the relay count to fingerprint column.
---
app.py | 6 +++---
compass.py | 4 ++--
templates/result.html | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app.py b/app.py
index d84cbdc..40de2fa 100644
--- a/app.py
+++ b/app.py
@@ -58,10 +58,10 @@ def parse(output_string, grouping=False, sort_key=None):
the elements and delete the last element in the list.
"""
if grouping:
- values[5] = "%s %s" % (values[5], values[6])
- for id in xrange(7, len(values)):
+ values[6] = "%s %s" % (values[6], values[7])
+ for id in xrange(8, len(values)):
values[id-1] = values[id]
- del values[id]
+ del values[-1]
# TODO: change inaccurate value of 10
if len(values) > 10:
diff --git a/compass.py b/compass.py
index a62fb3c..e478e8f 100755
--- a/compass.py
+++ b/compass.py
@@ -253,8 +253,8 @@ class RelayStats(object):
as_name = relay.get('as_name', '??')
relays_in_group += 1
if by_country or by_as_number:
- nickname = "(%d relays)" % relays_in_group
- fingerprint = "*"
+ nickname = "*"
+ fingerprint = "(%d relays)" % relays_in_group
exit = "*"
guard = "*"
if not by_as_number and not ases:
diff --git a/templates/result.html b/templates/result.html
index 8dc3b6e..a572933 100644
--- a/templates/result.html
+++ b/templates/result.html
@@ -78,7 +78,7 @@
<td>{{ result.p_exit }}</td>
<td>{{ result.nick }}</td>
<!-- this happens when we do groupings-->
- {% if result.fp == '*' %}
+ {% if "relays" in result.fp %}
<td>{{ result.fp }}</td>
{% else %}
<td><a href="https://atlas.torproject.org/#details/{{
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits