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

[tor-commits] [ooni-probe/master] Expose inputs_dir and decks_dir from configuration file



commit 4b302ffaeb0704c728123a6a23b722a4cabbb74c
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Apr 2 19:55:37 2015 +0200

    Expose inputs_dir and decks_dir from configuration file
---
 data/ooniprobe.conf.sample |    2 ++
 ooni/settings.py           |   12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/data/ooniprobe.conf.sample b/data/ooniprobe.conf.sample
index 9f6d0f4..e68b449 100644
--- a/data/ooniprobe.conf.sample
+++ b/data/ooniprobe.conf.sample
@@ -49,6 +49,8 @@ advanced:
     reporting_concurrency: 15
     oonid_api_port: 8042
     report_log_file: null
+    inputs_dir: null
+    decks_dir: null
 tor:
     #socks_port: 8801
     #control_port: 8802
diff --git a/ooni/settings.py b/ooni/settings.py
index 7fbc7af..ebaa1ff 100644
--- a/ooni/settings.py
+++ b/ooni/settings.py
@@ -96,8 +96,16 @@ class OConfig(object):
     def set_paths(self):
         self.nettest_directory = os.path.join(get_ooni_root(), 'nettests')
 
-        self.inputs_directory = os.path.join(self.ooni_home, 'inputs')
-        self.decks_directory = os.path.join(self.ooni_home, 'decks')
+        if self.advanced.inputs_dir:
+            self.inputs_directory = self.advanced.inputs_dir
+        else:
+            self.inputs_directory = os.path.join(self.ooni_home, 'inputs')
+
+        if self.advanced.decks_dir:
+            self.decks_directory = self.advanced.decks_dir
+        else:
+            self.decks_directory = os.path.join(self.ooni_home, 'decks')
+
         self.reports_directory = os.path.join(self.ooni_home, 'reports')
         self.resources_directory = os.path.join(self.data_directory,
                                                 "resources")



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