[tor-commits] [depictor/master] Write a historical version

tom at torproject.org tom at torproject.org
Mon Mar 23 16:32:51 UTC 2015


commit 4ef382841c2e2fe1057f36cbb4beab2559c74f5f
Author: Tom Ritter <tom at ritter.vg>
Date:   Wed Mar 4 17:53:12 2015 +0100

    Write a historical version
---
 .gitignore       |    2 +-
 website.py       |    2 ++
 write_website.py |    2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index e54e242..ad4f990 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,5 @@
 *.swp
 stem
 out/index.html
-out/consensus-health.html
+out/consensus-health*
 out/download-stats.csv
\ No newline at end of file
diff --git a/website.py b/website.py
index fbdf4ee..2de8cc2 100755
--- a/website.py
+++ b/website.py
@@ -54,6 +54,8 @@ class WebsiteWriter:
 		self.directory_key_warning_time = timedelta
 	def set_known_params(self, kp):
 		self.known_params = kp
+	def get_consensus_time(self):
+		return self.consensus.valid_after
 
 	#-----------------------------------------------------------------------------------------
 	def _write_page_header(self, include_relay_flags):
diff --git a/write_website.py b/write_website.py
index f445a8e..3e6a500 100755
--- a/write_website.py
+++ b/write_website.py
@@ -64,6 +64,8 @@ def main():
   w.set_consensuses(consensuses)
   w.set_votes(votes)
   w.set_known_params(CONFIG['known_params'])
+  w.write_website(os.path.join(os.path.dirname(__file__), 'out', \
+    'consensus-health-' + w.get_consensus_time().strftime("%Y-%m-%d-%H-%M") + '.html'), True)
   w.write_website(os.path.join(os.path.dirname(__file__), 'out', 'consensus-health.html'), True)
   w.write_website(os.path.join(os.path.dirname(__file__), 'out', 'index.html'), False)
 





More information about the tor-commits mailing list