# HG changeset patch # User Jeff Hammel # Date 1375831461 25200 # Node ID 6cd2894bb11cb90318253a9fa3c5a2680fc3a259 # Parent 197e7b523a07a8c7c75673f0c139958345903e18 stub: makeitso/script2package.py diff -r 197e7b523a07 -r 6cd2894bb11c makeitso/python.py --- a/makeitso/python.py Tue Jul 30 19:39:34 2013 -0700 +++ b/makeitso/python.py Tue Aug 06 16:24:21 2013 -0700 @@ -16,6 +16,8 @@ * ./web.py : a webob web handler """ +# TODO: console_scripts for all of these + import os import sys from cli import MakeItSoCLI diff -r 197e7b523a07 -r 6cd2894bb11c makeitso/script2package.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeitso/script2package.py Tue Aug 06 16:24:21 2013 -0700 @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +make a package from a .py file +""" + +### STUB ### +# TODO: +# - thing to make a setup.py from a .py file +# - use makeitso templates -> directory structure + +import optparse +import os +import subprocess +import sys + +def add_options(parser): + """add options to the OptionParser instance""" + +def main(args=sys.argv[1:]): + + # parse command line options + usage = '%prog [options] ...' + class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): + """description formatter for console script entry point""" + def format_description(self, description): + if description: + return description.strip() + '\n' + else: + return '' + parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) + options, args = parser.parse_args(args) + +if __name__ == '__main__': + main() +