comparison makeitso/script2package.py @ 164:6cd2894bb11c

stub: makeitso/script2package.py
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 06 Aug 2013 16:24:21 -0700
parents
children aed8c4af5f26
comparison
equal deleted inserted replaced
163:197e7b523a07 164:6cd2894bb11c
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 make a package from a .py file
6 """
7
8 ### STUB ###
9 # TODO:
10 # - thing to make a setup.py from a .py file
11 # - use makeitso templates -> directory structure
12
13 import optparse
14 import os
15 import subprocess
16 import sys
17
18 def add_options(parser):
19 """add options to the OptionParser instance"""
20
21 def main(args=sys.argv[1:]):
22
23 # parse command line options
24 usage = '%prog [options] ...'
25 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
26 """description formatter for console script entry point"""
27 def format_description(self, description):
28 if description:
29 return description.strip() + '\n'
30 else:
31 return ''
32 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
33 options, args = parser.parse_args(args)
34
35 if __name__ == '__main__':
36 main()
37