changeset 164:6cd2894bb11c

stub: makeitso/script2package.py
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 06 Aug 2013 16:24:21 -0700
parents 197e7b523a07
children f3e86e06eb12
files makeitso/python.py makeitso/script2package.py
diffstat 2 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- /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()
+