changeset 102:ad5fd3eb6674

template fixes....not the best, but will do
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 16:30:52 -0800
parents 80a57bf2b7f4
children a6aff990985b
files makeitso/python.py makeitso/python_package/README.txt makeitso/python_package/setup.py makeitso/python_package/tests/test.py makeitso/python_package/{{package}}/main.py makeitso/python_package/{{package}}/template.py setup.py
diffstat 6 files changed, 34 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/makeitso/python.py	Tue Jan 11 14:23:17 2011 -0800
+++ b/makeitso/python.py	Tue Jan 11 16:30:52 2011 -0800
@@ -21,7 +21,7 @@
 from optparse import OptionParser
 from template import MakeItSoTemplate
 
-class PythonPackage(MakeItSoTemplate):
+class PythonPackageTemplate(MakeItSoTemplate):
   """
   python package template
   """
@@ -39,11 +39,14 @@
   def __init__(self, **kw):
     MakeItSoTemplate.__init__(self, **kw)
 
+class PythonPackageCLI(MakeItSoCLI):
+  """
+  CLI front end for the python package template
+  """
 
-def main(args=sys.argv[:]):
-  usage = '%prog [options]'
-  
+def main(args=sys.argv[1:]):
+  cli = PythonPackageCLI(PythonPackageTemplate)
+  cli(*args)
 
 if __name__ == '__main__':
   main()  
-
--- a/makeitso/python_package/README.txt	Tue Jan 11 14:23:17 2011 -0800
+++ b/makeitso/python_package/README.txt	Tue Jan 11 16:30:52 2011 -0800
@@ -1,1 +1,10 @@
-Example single-file templates
+{{project}}
+===========
+
+{{description}}
+
+----
+
+{{author}}
+
+{{url}}
--- a/makeitso/python_package/setup.py	Tue Jan 11 14:23:17 2011 -0800
+++ b/makeitso/python_package/setup.py	Tue Jan 11 16:30:52 2011 -0800
@@ -1,7 +1,9 @@
+import os
 from setuptools import setup, find_packages
 
 try:
-    description = file('README.txt').read()
+    here = os.path.dirname(os.path.abspath(__file__))
+    description = file(os.path.join(here, 'README.txt')).read()
 except IOError: 
     description = ''
 
@@ -15,7 +17,7 @@
       author='{{author}}',
       author_email='{{email}}',
       url='{{url}}',
-      license='{{license}}'
+      license='',
       packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
       include_package_data=True,
       zip_safe=False,
--- a/makeitso/python_package/tests/test.py	Tue Jan 11 14:23:17 2011 -0800
+++ b/makeitso/python_package/tests/test.py	Tue Jan 11 16:30:52 2011 -0800
@@ -13,7 +13,7 @@
     tests =  [ test for test in os.listdir(directory)
                if test.endswith('.txt') ]
     for test in tests:
-        doctest.testfile(test, extraglobs=extraglobs, raise_on_error=True)
+        doctest.testfile(test, extraglobs=extraglobs, raise_on_error=False)
 
 if __name__ == '__main__':
     run_tests()
--- a/makeitso/python_package/{{package}}/template.py	Tue Jan 11 14:23:17 2011 -0800
+++ b/makeitso/python_package/{{package}}/template.py	Tue Jan 11 16:30:52 2011 -0800
@@ -24,7 +24,7 @@
 
 def main(args=sys.argv[:]):
   cli = TemplateCLI()
-  cli(args)
+  cli(*args)
   
 if __name__ == '__main__':
   main()  
--- a/setup.py	Tue Jan 11 14:23:17 2011 -0800
+++ b/setup.py	Tue Jan 11 16:30:52 2011 -0800
@@ -1,12 +1,18 @@
+import os
 from setuptools import setup, find_packages
 
-version = '0.0'
+try:
+    here = os.path.dirname(os.path.abspath(__file__))
+    description = file(os.path.join(here, 'README.txt')).read()
+except IOError:
+    description = ''
+
+version = '0.1'
 
 setup(name='MakeItSo',
       version=version,
       description='filesystem template interpreter',
-      long_description="""\
-""",
+      long_description=description,
       classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
       keywords='',
       author='Jeff Hammel',
@@ -25,5 +31,6 @@
       # -*- Entry points: -*-
       [console_scripts]
       makeitso = makeitso.makeitso:main
+      make-python-package = makeitso.python:main
       """,
       )