[tor-commits] [depictor/master] gzip the archival version of consensus-health.html

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


commit 932b67dfde560fcc1739fe200040c39a5368b986
Author: Tom Ritter <tom at ritter.vg>
Date:   Sun Mar 8 11:46:24 2015 -0500

    gzip the archival version of consensus-health.html
---
 write_website.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/write_website.py b/write_website.py
index 99e18c5..c0deac6 100755
--- a/write_website.py
+++ b/write_website.py
@@ -12,6 +12,7 @@ import time
 import datetime
 import operator
 import traceback
+import subprocess
 
 import stem.descriptor
 import stem.descriptor.remote
@@ -64,11 +65,14 @@ def main():
   w.set_consensuses(consensuses)
   w.set_votes(votes)
   w.set_config(CONFIG)
-  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)
 
+  archived = os.path.join(os.path.dirname(__file__), 'out', \
+						  'consensus-health-' + w.get_consensus_time().strftime("%Y-%m-%d-%H-%M") + '.html')
+  subprocess.call(["cp", os.path.join(os.path.dirname(__file__), 'out', 'consensus-health.html'), archived])
+  subprocess.call(["gzip", "-9", archived])
+
 
 def get_consensuses():
   """





More information about the tor-commits mailing list