Skip to content

Commit

Permalink
lbugz: convert to pure python
Browse files Browse the repository at this point in the history
Since we are now using entry points, this script can call the main
function directly.
  • Loading branch information
williamh committed Sep 17, 2015
1 parent 0435113 commit c4060e5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lbugz
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ 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')
sys.path.insert(0, os.path.dirname(__file__))

if os.path.exists(pkg) and os.path.exists(script):
args[0] = script
if 'PYTHONPATH' in os.environ:
os.environ['PYTHONPATH'] = path + ':' + os.environ['PYTHONPATH']
else:
os.environ['PYTHONPATH'] = path + ':'
sys.exit(subprocess.call(args))
from bugz.main import main

if __name__ == "__main__":
main()

0 comments on commit c4060e5

Please sign in to comment.