view stampit/main.py @ 2:164af2a4d291

better description formatting
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 19 Apr 2010 15:17:08 -0700
parents 820beace15f2
children 6ef0e769248d
line wrap: on
line source

#!/usr/bin/env python
"""
tar up a set of packages in a virtualenv per platform:

<package>-<version>-<platform>.tar.gz

Example:

mozmill-1.4.1-linux.tar.gz
"""

import sys

from optparse import OptionParser, IndentedHelpFormatter, HelpFormatter
from subprocess import call

class UnformattedDescription(IndentedHelpFormatter):
    def format_description(self, description):
        return description.strip() or ''

def main(args=sys.argv[1:]):
    usage = '%prog [options] <package> <platform>'
    parser = OptionParser(usage, description=globals()['__doc__'],
                          formatter=UnformattedDescription())
    parser.add_option('--version',
                      help='version of the package to be installed (defaults to the current on the cheeseshop)')
    options, args = parser.parse_args(args)

    if not args:
        parser.print_help()
        sys.exit(0)

    # create a virtualenv
#    call(['virtualenv'])

if __name__ == '__main__':
    main()