Mercurial > hg > MakeItSo
comparison makeitso/python.py @ 151:e70421c50d0a
move to ABC
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sat, 01 Dec 2012 19:01:18 -0800 |
| parents | 4922bee3d080 |
| children | 386a44a52139 |
comparison
equal
deleted
inserted
replaced
| 150:59feed7c9b4a | 151:e70421c50d0a |
|---|---|
| 22 from makeitso import ContentTemplate | 22 from makeitso import ContentTemplate |
| 23 from optparse import OptionParser | 23 from optparse import OptionParser |
| 24 from template import MakeItSoTemplate | 24 from template import MakeItSoTemplate |
| 25 from template import Variable | 25 from template import Variable |
| 26 | 26 |
| 27 class PythonModuleTemplate(MakeItSoTemplate): | 27 class PythonTemplate(MakeItSoTemplate): |
| 28 """abstract base class for python-type templates""" | |
| 29 | |
| 30 class PythonModuleTemplate(PythonTemplate): | |
| 28 """single module python package""" | 31 """single module python package""" |
| 29 templates = ['python_module'] | 32 templates = ['python_module'] |
| 30 | 33 |
| 31 class PythonPackageTemplate(MakeItSoTemplate): | 34 class PythonPackageTemplate(PythonTemplate): |
| 32 """ | 35 """ |
| 33 python package template | 36 python package template |
| 34 """ | 37 """ |
| 35 name = 'python-package' | 38 name = 'python-package' |
| 36 templates = ['python_package'] | 39 templates = ['python_package'] |
| 46 dependencies = {'web.py': ['webob'], | 49 dependencies = {'web.py': ['webob'], |
| 47 'template.py': ['MakeItSo']} | 50 'template.py': ['MakeItSo']} |
| 48 console_scripts = {'main.py': '{{project}} = {{project}}.main:main', | 51 console_scripts = {'main.py': '{{project}} = {{project}}.main:main', |
| 49 'template.py': '{{project}}-template = {{project}}.template:main' | 52 'template.py': '{{project}}-template = {{project}}.template:main' |
| 50 } | 53 } |
| 51 | 54 |
| 52 def __init__(self, **kw): | 55 def __init__(self, **kw): |
| 53 MakeItSoTemplate.__init__(self, **kw) | 56 MakeItSoTemplate.__init__(self, **kw) |
| 54 | 57 |
| 55 # TODO: get the templates you actually care about [maybe from the CLI?] | 58 # TODO: get the templates you actually care about [maybe from the CLI?] |
| 56 | 59 |
