[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Add wrapper scripts to avoid PYTHONPATH madness!
commit 5cfd7e7bff7728557a5a628f86c2922837f2b24d
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date: Tue Jul 24 22:41:45 2012 +0200
Add wrapper scripts to avoid PYTHONPATH madness!
---
bin/oonib | 4 ++++
bin/ooniprobe | 4 ++++
oonib/lib/__init__.py | 6 ++++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/bin/oonib b/bin/oonib
new file mode 100755
index 0000000..df7c62f
--- /dev/null
+++ b/bin/oonib
@@ -0,0 +1,4 @@
+#!/bin/sh
+ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
+export PYTHONPATH=$PYTHONPATH:$ROOT
+twistd -ny $ROOT/oonib/oonibackend.py
diff --git a/bin/ooniprobe b/bin/ooniprobe
new file mode 100755
index 0000000..505e1c2
--- /dev/null
+++ b/bin/ooniprobe
@@ -0,0 +1,4 @@
+#!/bin/sh
+ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
+export PYTHONPATH=$PYTHONPATH:$ROOT
+python $ROOT/ooni/ooniprobe.py
diff --git a/oonib/lib/__init__.py b/oonib/lib/__init__.py
index 2f1b6f9..5b4380a 100644
--- a/oonib/lib/__init__.py
+++ b/oonib/lib/__init__.py
@@ -1,6 +1,8 @@
from ooni.utils import Storage
from ooni.utils.config import Config
+import os
+root = os.path.normpath(os.path.join(os.path.realpath(__file__), '../../'))
config = Storage()
-config.main = Config('main', 'oonibackend.conf')
-config.daphn3 = Config('daphn3', 'oonibackend.conf')
+config.main = Config('main', os.path.join(root, 'oonibackend.conf'))
+config.daphn3 = Config('daphn3', os.path.join(root, 'oonibackend.conf'))
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits