comparison makeitso/python.py @ 160:9033a5f11b92

wip
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 30 Jul 2013 15:29:56 -0700
parents cfd4f1e91090
children a5d058957734
comparison
equal deleted inserted replaced
159:cfd4f1e91090 160:9033a5f11b92
24 from template import MakeItSoTemplate 24 from template import MakeItSoTemplate
25 from template import Variable 25 from template import Variable
26 26
27 class PythonTemplate(MakeItSoTemplate): 27 class PythonTemplate(MakeItSoTemplate):
28 """abstract base class for python-type templates""" 28 """abstract base class for python-type templates"""
29 vars = [Variable('description'),
30 Variable('author', 'author of the package'),
31 Variable('email', "author's email"),
32 Variable('url', 'project url'),
33 Variable('repo', 'project repository'),
34 ]
29 35
30 def path2name(self, path): 36 def path2name(self, path):
31 return os.path.basename(path.rstrip(os.path.sep)) 37 return os.path.basename(path.rstrip(os.path.sep))
32 38
33 class PythonScriptTemplate(PythonTemplate): 39 class PythonScriptTemplate(PythonTemplate):
34 """template for a single python script""" 40 """template for a single python script"""
35 templates = [('python_package', '{{package}}', '{{main}}.py')] 41 templates = [('python_package', '{{package}}', '{{main}}.py')]
36 42 vars = [Variable('description')]
37 43
38 class PythonModuleTemplate(PythonTemplate): 44 class PythonModuleTemplate(PythonTemplate):
39 """single module python package""" 45 """single module python package"""
40 # TODO: this should use the same files as PythonPackageTemplate 46 # TODO: this should use the same files as PythonPackageTemplate
41 templates = ['python_module', 47 templates = ['python_module',