forked from williamh/pybugz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lbugz
executable file
·28 lines (22 loc) · 788 Bytes
/
lbugz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
"""
lbugz: execute bugz from the git repository.
This script is primarily used to test bugz. It is a wrapper which adds
the package directory to the system path and executes bin/bugz from the
git repository passing along any arguments supplied to it.
This is based on a patch from Mike Frysinger <vapier@gentoo.org>.
"""
import os
import subprocess
import sys
args = sys.argv
path = os.path.normpath(os.path.dirname(os.path.realpath(__file__)))
pkg = os.path.join(path, 'bugz')
script = os.path.join(path, 'bin/bugz')
if os.path.exists(pkg) and os.path.exists(script):
args[0] = script
if 'PYTHONPATH' in os.environ.keys():
os.environ['PYTHONPATH'] = path + ':' + os.environ['PYTHONPATH']
else:
os.environ['PYTHONPATH'] = path + ':'
subprocess.call(args)