Skip to content

Commit

Permalink
Add wrapper scripts to avoid PYTHONPATH madness!
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Jul 24, 2012
1 parent 64ed356 commit 5cfd7e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions bin/oonib
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
export PYTHONPATH=$PYTHONPATH:$ROOT
twistd -ny $ROOT/oonib/oonibackend.py
4 changes: 4 additions & 0 deletions bin/ooniprobe
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
export PYTHONPATH=$PYTHONPATH:$ROOT
python $ROOT/ooni/ooniprobe.py
6 changes: 4 additions & 2 deletions oonib/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -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'))

0 comments on commit 5cfd7e7

Please sign in to comment.