Merge lp:~jml/pkgme/pass-on-pythonpath into lp:pkgme

Proposed by Jonathan Lange
Status: Rejected
Rejected by: Jonathan Lange
Proposed branch: lp:~jml/pkgme/pass-on-pythonpath
Merge into: lp:pkgme
Diff against target: 23 lines (+3/-1)
1 file modified
pkgme/run_script.py (+3/-1)
To merge this branch: bzr merge lp:~jml/pkgme/pass-on-pythonpath
Reviewer Review Type Date Requested Status
pkgme committers Pending
Review via email: mp+69257@code.launchpad.net

Description of the change

Passes on the sys.path of the pkgme executable to any backends as a PYTHONPATH executable. It means that if a backend is a Python script, it will be able to import the same modules that pkgme itself is using.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pkgme/run_script.py'
2--- pkgme/run_script.py 2011-04-15 19:18:29 +0000
3+++ pkgme/run_script.py 2011-07-26 11:25:50 +0000
4@@ -1,6 +1,7 @@
5 import errno
6 import os
7 import subprocess
8+import sys
9
10
11 class ScriptProblem(Exception):
12@@ -36,9 +37,10 @@
13 helperpath = os.path.join(
14 os.path.dirname(os.path.dirname(basepath)), 'helpers')
15 env = os.environ.copy()
16+ env['PYTHONPATH'] = os.pathsep.join(sys.path)
17 if os.path.isdir(helperpath):
18 if 'PATH' in env:
19- env['PATH'] = env['PATH'] + ':' + helperpath
20+ env['PATH'] = os.pathsep.join(env['PATH'], helperpath)
21 else:
22 env['PATH'] = helperpath
23 try:

Subscribers

People subscribed via source and target branches