|
@@ -88,6 +88,12 @@ OUTPUT_COMMENTS = True if OUTPUT_CANDIDATES else False
|
|
|
CONTACT_COUNT = True if OUTPUT_CANDIDATES else False
|
|
|
CONTACT_BLACKLIST_COUNT = True if OUTPUT_CANDIDATES else False
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+OUTPUT_SORT_FIELD = 'contact' if OUTPUT_CANDIDATES else 'fingerprint'
|
|
|
+
|
|
|
|
|
|
|
|
|
ONIONOO = 'https://onionoo.torproject.org/'
|
|
@@ -1304,10 +1310,9 @@ class CandidateList(dict):
|
|
|
self.fallbacks.sort(key=lambda f: f._data['measured_bandwidth'],
|
|
|
reverse=True)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- def sort_fallbacks_by_fingerprint(self):
|
|
|
- self.fallbacks.sort(key=lambda f: f._fpr)
|
|
|
+
|
|
|
+ def sort_fallbacks_by(self, data_field):
|
|
|
+ self.fallbacks.sort(key=lambda f: f._data[data_field])
|
|
|
|
|
|
@staticmethod
|
|
|
def load_relaylist(file_name):
|
|
@@ -1992,12 +1997,14 @@ def list_fallbacks():
|
|
|
for s in fetch_source_list():
|
|
|
print describe_fetch_source(s)
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if not OUTPUT_CANDIDATES:
|
|
|
- candidates.sort_fallbacks_by_fingerprint()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ candidates.sort_fallbacks_by(OUTPUT_SORT_FIELD)
|
|
|
|
|
|
for x in candidates.fallbacks:
|
|
|
print x.fallbackdir_line(candidates.fallbacks, prefilter_fallbacks)
|