diff makeitso/python.py @ 78:d4184945f8a8

stub out python package creation
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 08 Jan 2011 17:54:58 -0800
parents
children e74baa8e6df4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makeitso/python.py	Sat Jan 08 17:54:58 2011 -0800
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+"""
+python package templates for makeitso
+
+Several components are included.
+[TODO] You may use these subtemplates in any combination.
+
+* README.txt : a README in restructured text
+* examples : examples for your package
+* setup.py : setup utility for the full package
+* ./main.py : CLI handler for your webapp
+* ./model.py : model of a persisted object
+* ./template.py : a MakeItSo template for project creation
+* ./tests : doctest suite for the package
+* ./web.py : a webob web handler
+"""
+
+import sys
+from cli import MakeItSoCLI
+from optparse import OptionParser
+from template import MakeItSoTemplate
+
+class PythonPackage(MakeItSoTemplate):
+  """
+  python package template
+  """
+  name = 'python-package'
+  templates = ['python_package']
+  look = True
+
+  # things that go in setup.py
+  dependencies = {'web.py': ['webob'],
+                  'template.py': ['MakeItSo']}
+  console_scripts = {'main.py': '{{project}}.main:main',
+                     'template.py': '{{project}}.template:main'
+                     }
+  
+  def __init__(self, **kw):
+    MakeItSoTemplate.__init__(self, **kw)
+
+def main(args=sys.argv[:]):
+  usage = '%prog [options]'
+  
+
+if __name__ == '__main__':
+  main()  
+