new file mode 100644
@@ -0,0 +1,15 @@
+"""Add the <patchwork>/apps and <patchwork>/lib/python directories to
+sys.path.
+
+Also sets the DJANGO_SETTINGS_MODULE environment variable to 'settings'.
+"""
+import os
+import sys
+
+
+patchwork_bin = os.path.dirname(__file__)
+patchwork_base = os.path.abspath(
+ os.path.join(patchwork_bin, '..', '..', '..'))
+sys.path.insert(0, '%s/lib/python' % patchwork_base)
+sys.path.insert(0, '%s/apps' % patchwork_base)
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
This is so that we don't have to write a wrapper shell script for every python script we have in app/patchwork/bin/. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> --- apps/patchwork/bin/_pythonpath.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) create mode 100644 apps/patchwork/bin/_pythonpath.py