From: Oleg Broytman Date: Wed, 21 Sep 2016 00:00:48 +0000 (+0300) Subject: Use {project} as the placeholder X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=77a81b6bc40d9349b5236e59bf261a67482e5fa0;p=cookiecutter.git Use {project} as the placeholder --- diff --git a/cookiecutter b/cookiecutter index 34e5cfe..5973f10 100755 --- a/cookiecutter +++ b/cookiecutter @@ -14,8 +14,8 @@ cp -ap project_template "$HOME/tmp/$project_name" && cd "$HOME/tmp/$project_name" && mv project "$project_name" && -replace -i "template project" "$project_name" README.txt setup.py && -replace project "$project_name" docs/genapidocs mk-distr publish-docs setup.py tox.ini && +replace '{project}' "$project_name" README.txt docs/genapidocs mk-distr \ + publish-docs setup.py tox.ini && sphinx-quickstart --project="$project_name" --author="Oleg Broytman" \ -v0.0 -r0.0.1 --ext-autodoc --makefile --no-batchfile -q docs && diff --git a/project_template/README.txt b/project_template/README.txt index 4df0ba5..61d8414 100644 --- a/project_template/README.txt +++ b/project_template/README.txt @@ -1,5 +1,5 @@ -Broytman Template Project, Copyright (C) 2016 PhiloSoft Design +Broytman {project}, Copyright (C) 2016 PhiloSoft Design Author: Oleg Broytman License: GPL -This is a template project. +This is {project}. diff --git a/project_template/docs/genapidocs b/project_template/docs/genapidocs index 552c26b..1e305d0 100755 --- a/project_template/docs/genapidocs +++ b/project_template/docs/genapidocs @@ -2,4 +2,4 @@ cd "`dirname $0`"/.. && exec sphinx-apidoc --separate --module-first --suffix=rst --force \ - --output-dir=docs/api project + --output-dir=docs/api {project} diff --git a/project_template/mk-distr b/project_template/mk-distr index 6c946f6..ee5ea8a 100755 --- a/project_template/mk-distr +++ b/project_template/mk-distr @@ -2,13 +2,13 @@ umask 022 && -git archive --format=tar --prefix=project/ "${1:-HEAD}" | +git archive --format=tar --prefix={project}/ "${1:-HEAD}" | (cd "$HOME/tmp" && exec tar xf -) && -cp -ap docs "$HOME/tmp/project" && +cp -ap docs "$HOME/tmp/{project}" && -cd "$HOME/tmp/project" && +cd "$HOME/tmp/{project}" && chmod -R u=rwX,go=rX docs && python setup.py sdist --formats=bztar && -cd dist && mv project-*.tar.bz2 ../.. && cd ../.. && exec rm -rf project +cd dist && mv {project}-*.tar.bz2 ../.. && cd ../.. && exec rm -rf {project} diff --git a/project_template/publish-docs b/project_template/publish-docs index 6e52773..bca4083 100755 --- a/project_template/publish-docs +++ b/project_template/publish-docs @@ -1,6 +1,6 @@ #! /bin/sh -web="$HOME"/Internet/WWW/htdocs/phdru.name/Software/Python/project/docs +web="$HOME"/Internet/WWW/htdocs/phdru.name/Software/Python/{project}/docs cd "`dirname \"$0\"`"/docs/_build/html && rsync -ahP --del * --exclude=objects.inv "$web" && diff --git a/project_template/setup.py b/project_template/setup.py index 3b4e7b0..3c07eb8 100755 --- a/project_template/setup.py +++ b/project_template/setup.py @@ -15,14 +15,14 @@ except ImportError: from distutils.core import setup is_setuptools = False -versionpath = join(abspath(dirname(__file__)), 'project', '__version__.py') -load_source('project_version', versionpath) +versionpath = join(abspath(dirname(__file__)), '{{project}}', '__version__.py') +load_source('{project}_version', versionpath) # Ignore: E402 module level import not at top of file -from project_version import __version__ # noqa +from {project}_version import __version__ # noqa -setup(name='Template project', +setup(name='{{project}}', version=__version__, - description='Broytman Template Project', + description='Broytman {{project}}', long_description=open('README.txt', 'rtU').read(), author='Oleg Broytman', author_email='phd@phdru.name', @@ -42,8 +42,8 @@ setup(name='Template project', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ], - packages=['project'], - package_data={'project': []}, + packages=['{{project}}'], + package_data={'{{project}}': []}, scripts=[], requires=[], ) diff --git a/project_template/tox.ini b/project_template/tox.ini index 01864e4..39baacd 100644 --- a/project_template/tox.ini +++ b/project_template/tox.ini @@ -18,7 +18,7 @@ whitelist_externals = [general] commands = - python /usr/local/bin/py.test --cov={envsitepackagesdir}/project + python /usr/local/bin/py.test --cov={envsitepackagesdir}/{project} [testenv:py26] commands = {[general]commands} @@ -32,9 +32,9 @@ commands = {[general]commands} [testenv:py27-flake8] deps = flake8 -commands = flake8 project scripts tests +commands = flake8 {project} scripts tests [testenv:py34-flake8] deps = flake8 -commands = flake8 project scripts tests +commands = flake8 {project} scripts tests