[tor-commits] [depictor/master] Actually, lets promote Unmeasured to a real pseudo-flag (part of #24691)

tom at torproject.org tom at torproject.org
Sat Jan 6 05:52:08 UTC 2018


commit 851852f884f4637b0d59a6b37135bd2677689334
Author: Tom Ritter <tom at ritter.vg>
Date:   Fri Jan 5 23:51:58 2018 -0600

    Actually, lets promote Unmeasured to a real pseudo-flag (part of #24691)
---
 website.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/website.py b/website.py
index 6a75dc2..2e70fb4 100755
--- a/website.py
+++ b/website.py
@@ -121,6 +121,19 @@ class WebsiteWriter:
 				if r in self.fallback_dirs:
 					self.consensus.routers[r].flags.append('FallbackDir')
 
+		# Create an Unmeasured flag
+		self.consensus.known_flags.append('Unmeasured')
+		for dirauth_nickname in self.known_authorities:
+			if dirauth_nickname in self.votes:
+				vote = self.votes[dirauth_nickname]
+				vote.known_flags.append('Unmeasured')
+				for r in vote.routers:
+					if r in self.consensus.routers and self.consensus.routers[r].is_unmeasured and not vote.routers[r].measured:
+						vote.routers[r].flags.append('Unmeasured')
+		for r in self.consensus.routers:
+			if self.consensus.routers[r].is_unmeasured:
+				self.consensus.routers[r].flags.append('Unmeasured')
+
 
 	#-----------------------------------------------------------------------------------------
 	def _write_page_header(self, include_relay_info):
@@ -1430,11 +1443,7 @@ class WebsiteWriter:
 				self.site.write(" <br />" if flagsWritten > 0 else "")
 				self.site.write("bw=" + str(self.consensus.routers[relay_fp].bandwidth))
 				flagsWritten += 1
-				if self.consensus.routers[relay_fp].is_unmeasured:
-					self.site.write(" <br />" if flagsWritten > 0 else "")
-					self.site.write("Unmeasured")
-					flagsWritten += 1
-				else:
+				if not self.consensus.routers[relay_fp].is_unmeasured:
 					assigning_bwauths = self.__find_assigning_bwauth_for_bw_value(relay_fp)
 					self.site.write(" <br />" if flagsWritten > 0 else "")
 					self.site.write("bwauth=" + ",".join(assigning_bwauths))



More information about the tor-commits mailing list