# HG changeset patch # User Jeff Hammel # Date 1294792252 28800 # Node ID ad5fd3eb667461e512862a72dc0cf24c704ca6df # Parent 80a57bf2b7f4702393c3b2b14ec3a2b0d2f1f059 template fixes....not the best, but will do diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python.py --- 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() - diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python_package/README.txt --- 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}} diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python_package/setup.py --- 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, diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python_package/tests/test.py --- 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() diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python_package/{{package}}/main.py diff -r 80a57bf2b7f4 -r ad5fd3eb6674 makeitso/python_package/{{package}}/template.py --- 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() diff -r 80a57bf2b7f4 -r ad5fd3eb6674 setup.py --- 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 """, )