[tor-commits] [ooni-probe/master] Place the right paths in the ooniprobe sample config

art at torproject.org art at torproject.org
Wed Jun 19 12:32:46 UTC 2013


commit aafc5b726d33b5af9caba8e3693548f5c5284e43
Author: Arturo Filastò <art at fuffa.org>
Date:   Mon Jun 17 13:28:15 2013 +0200

    Place the right paths in the ooniprobe sample config
---
 setup.py |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/setup.py b/setup.py
index ec4b353..5f221d0 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,15 @@ usr_share_path = '/usr/share/ooni'
 # If this is true then it means we are in a virtualenv
 if hasattr(sys, 'real_prefix'):
     usr_share_path = pj(sys.prefix, 'share', 'ooni')
+    with open(pj('data', 'ooniprobe.conf.sample.new'), 'w+') as w:
+        with open(pj('data', 'ooniprobe.conf.sample')) as f:
+            for line in f:
+                if line.startswith('    data_dir: /usr/share/ooni'):
+                    w.write('    data_dir: %s\n' % usr_share_path)
+                else:
+                    w.write(line)
+    os.rename(pj('data', 'ooniprobe.conf.sample.new'),
+              pj('data', 'ooniprobe.conf.sample'))
 
 data_files = []
 for root, dirs, file_names in os.walk('data/'):





More information about the tor-commits mailing list