Permalink
Browse files

Program to run stoneridge python from system python

  • Loading branch information...
1 parent ae00eac commit 47ee9ca98a3eb17328e6ec9d0f36120cee18ca25 @nwgh nwgh committed Jun 14, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 srrun.py
View
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at http://mozilla.org/MPL/2.0/.
+
+import copy
+import os
+import subprocess
+import sys
+
+mypath = os.path.abspath(__file__)
+mydir = os.path.split(mypath)[0]
+srhome = os.path.join(mydir, '..')
+srhome = os.path.abspath(srhome)
+srbin = os.path.join(srhome, 'bin')
+srpython = os.path.join(srbin, 'python')
+srpypath = [mydir, os.path.join(mydir, 'wpr')]
+
+env = copy.copy(os.environ)
+env['PYTHONPATH'] = ':'.join(srpypath)
+
+sys.exit(subprocess.call([srpython] + sys.argv[1:], env=env))

0 comments on commit 47ee9ca

Please sign in to comment.