[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [depictor/master] When an assigning bwauth is not present, it (should be) because we are missing the vote of the assigning bwauth. Explain that in a footnote.



commit a8be94bc374c2c5137ede0377c304b850086ee73
Author: Tom Ritter <tom@xxxxxxxxx>
Date:   Thu Feb 15 10:39:20 2018 -0600

    When an assigning bwauth is not present, it (should be) because we are missing the vote of the assigning bwauth. Explain that in a footnote.
    
    Closes #24628
---
 out/stylesheet-ltr.css |  7 +++++--
 website.py             | 15 ++++++++++++++-
 write_website.py       |  8 ++++----
 3 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/out/stylesheet-ltr.css b/out/stylesheet-ltr.css
index 8ace3a9..78e070c 100644
--- a/out/stylesheet-ltr.css
+++ b/out/stylesheet-ltr.css
@@ -34,12 +34,15 @@ li {
     text-align: left;
 }
 
-div.bottom {
+.bottom {
     font-size: 0.8em;
+    text-align: center;
+}
+
+div.bottom {
     margin-top: 0.5cm;
     margin-left: 1em;
     margin-right: 1em;
-    text-align: center;
 }
 
 /* The main column (left text) */
diff --git a/website.py b/website.py
index c52bd6e..a61a5c3 100755
--- a/website.py
+++ b/website.py
@@ -77,6 +77,11 @@ class WebsiteWriter:
 		self.fallback_dirs = fallback_dirs
 	def get_consensus_time(self):
 		return self.consensus.valid_after
+	def all_votes_present(self):
+		for dirauth_nickname in self.known_authorities:
+			if dirauth_nickname not in self.votes:
+				return False
+		return True
 
 	#-----------------------------------------------------------------------------------------
 	def _add_pseudo_flags(self):
@@ -1324,6 +1329,10 @@ class WebsiteWriter:
 			self._write_relay_info_tableRow(relay_fp, allRelays[relay_fp])
 
 		self.site.write("</table>\n")
+		self.site.write("<p class=\"bottom\"><sup>1</sup> We are missing at least one vote, and"
+		+ " the assigning bwauth is probably one of the missing vote(s).&nbsp;&nbsp;<sup>2</sup>"
+		+ " This is a bug, please report it (and the consensus time)</p>")
+
 
 	#-----------------------------------------------------------------------------------------	
 	def _write_relay_info_tableHeader(self):
@@ -1446,7 +1455,11 @@ class WebsiteWriter:
 				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) + " ")
+					self.site.write("bwauth=" + ",".join(assigning_bwauths))
+					if not assigning_bwauths and not self.all_votes_present():
+						self.site.write("<sup>1</sup>")
+					elif not assigning_bwauths:
+						self.site.write("<sup>2</sup>")
 					flagsWritten += 1
 
 			self.site.write("</td>\n")
diff --git a/write_website.py b/write_website.py
index 47cbb4b..8662011 100755
--- a/write_website.py
+++ b/write_website.py
@@ -72,10 +72,10 @@ def main():
 		fallback_dirs = []
 	
 	# great for debugging
-	#import pickle
-	#pickle.dump(consensuses, open('consensus.p', 'wb'))
-	#pickle.dump(votes, open('votes.p', 'wb'))
-	#pickle.dump(fallback_dirs, open('fallback_dirs.p', 'wb'))
+	import pickle
+	pickle.dump(consensuses, open('consensus.p', 'wb'))
+	pickle.dump(votes, open('votes.p', 'wb'))
+	pickle.dump(fallback_dirs, open('fallback_dirs.p', 'wb'))
 
 
 	dbc = sqlite3.connect(os.path.join('data', 'historical.db'))

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits