root/releases/pkgcore/0.2.11/bin/pwrapper @ marienz%2540gentoo.org-20061027035730-eafc81fa7bebbee9

Revision marienz%2540gentoo.org-20061027035730-eafc81fa7bebbee9, 0.7 KB (checked in by Marien Zwart <marienz@…>, 2 years ago)

Subcommand support for util.commandline.

  • Property executable set to True
Line 
1#!/usr/bin/env python
2
3"""Wrapper script that messes with sys.path and runs scripts.
4
5This should only be run from inside the "bin" subdir of a pkgcore
6checkout or unpacked tarball. It adds the parent of that "bin" dir to
7sys.path unconditionally.
8"""
9
10import os.path as osp
11import sys
12
13sys.path.insert(0, osp.dirname(osp.dirname(osp.abspath(__file__))))
14
15from pkgcore.util import modules, commandline
16
17
18if __name__ == '__main__':
19    name = osp.basename(sys.argv[0])
20    script = modules.load_module('pkgcore.scripts.%s' % (name,))
21    subcommands = getattr(script, 'commandline_commands', None)
22    if subcommands is None:
23        subcommands = {None: (script.OptionParser, script.main)}
24    commandline.main(subcommands)
Note: See TracBrowser for help on using the browser.