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

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



commit aafc5b726d33b5af9caba8e3693548f5c5284e43
Author: Arturo Filastò <art@xxxxxxxxx>
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/'):



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