├── requirements.txt ├── MANIFEST.in ├── .gitignore ├── README.rst ├── LICENSE ├── bottle_boilerplate.py └── setup.py /requirements.txt: -------------------------------------------------------------------------------- 1 | cookiecutter 2 | click==6.2 3 | 4 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include requirements.txt 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | 45 | # Rope 46 | .ropeproject 47 | 48 | # Django stuff: 49 | *.log 50 | *.pot 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | bottle-boilerplate 3 | ================== 4 | 5 | Boilerplate code for new Bottle projects 6 | 7 | 8 | What Bottle Boilerplate does? 9 | ----------------------------- 10 | 11 | Build an structure to create applications in the rigth way with Bottle, using MVC (Model-View-Controller) and Tests. 12 | 13 | 14 | Installation 15 | ------------ 16 | 17 | .. code-block:: bash 18 | 19 | pip install bottle-boilerplate 20 | 21 | 22 | Used 23 | ---- 24 | 25 | Start new project: 26 | 27 | .. code-block:: bash 28 | 29 | bottle-boilerplate startproject YOUR-PROJECT-NAME 30 | cd YOUR-PROJECT-NAME 31 | pip install -r requirements.txt 32 | 33 | To run your application: 34 | 35 | .. code-block:: bash 36 | 37 | python manage.py runserver 38 | 39 | Open Bottle documentation: 40 | 41 | 42 | .. code-block:: bash 43 | 44 | bottle-boilerplate doc 45 | 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Thiago Avelino 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bottle_boilerplate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | import click 4 | from cookiecutter.main import cookiecutter 5 | 6 | 7 | @click.group() 8 | def cmds(): 9 | pass 10 | 11 | 12 | @cmds.command() 13 | @click.argument('project_name', type=str) 14 | def startproject(project_name): 15 | click.echo(u'Bottle Boilerplate start new project...') 16 | repo_name = project_name.lower().replace(' ', '-') 17 | app_name = repo_name.replace("-", "") 18 | extra_context = { 19 | 'project_name': project_name, 20 | "repo_name": repo_name, 21 | "app_name": app_name, 22 | "pkg_name": app_name 23 | } 24 | cookiecutter( 25 | 'https://github.com/avelino/cookiecutter-bottle.git', 26 | no_input=True, 27 | extra_context=extra_context) 28 | 29 | 30 | @cmds.command() 31 | @click.argument('project_name', type=str) 32 | def sample(project_name): 33 | click.echo(u'Bottle Boilerplate start new sample project...') 34 | repo_name = project_name.lower().replace(' ', '-') 35 | app_name = repo_name.replace("-", "") 36 | extra_context = { 37 | 'project_name': project_name, 38 | "repo_name": repo_name, 39 | "app_name": app_name, 40 | "pkg_name": app_name 41 | } 42 | cookiecutter( 43 | 'https://github.com/avelino/cookiecutter-bottle-sample.git', 44 | no_input=True, 45 | extra_context=extra_context) 46 | 47 | 48 | @cmds.command() 49 | @click.option('--version', type=str, default="dev", 50 | help=u'Set version to search!') 51 | def doc(version): 52 | if version not in ["dev", "0.12", "0.11", "0.10", "0.9"]: 53 | version = "dev" 54 | url = 'http://bottlepy.org/docs/{}/'.format(version) 55 | click.launch(url) 56 | click.echo(u'Bottle Boilerplate start browser!') 57 | 58 | 59 | def main(): 60 | cmds() 61 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding:utf-8 -*- 3 | from setuptools import setup 4 | 5 | 6 | REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()] 7 | 8 | classifiers = [ 9 | "Framework :: Bottle", 10 | 'Development Status :: 3 - Alpha', 11 | 'Environment :: Console', 12 | 'Intended Audience :: Developers', 13 | 'Natural Language :: English', 14 | 'License :: OSI Approved :: BSD License', 15 | 'Programming Language :: Python', 16 | 'Programming Language :: Python :: 2', 17 | 'Programming Language :: Python :: 2.7', 18 | 'Programming Language :: Python :: 3', 19 | 'Programming Language :: Python :: 3.3', 20 | 'Programming Language :: Python :: 3.4', 21 | 'Programming Language :: Python :: Implementation :: CPython', 22 | 'Programming Language :: Python :: Implementation :: PyPy', 23 | 'Topic :: Software Development'] 24 | 25 | description = "Boilerplate code for new Bottle projects" 26 | try: 27 | long_description = open('README.rst').read() 28 | except: 29 | long_description = description 30 | 31 | url = 'https://github.com/bottlepy/bottle-boilerplate' 32 | 33 | setup(name='bottle-boilerplate', 34 | version=0.3, 35 | description=description, 36 | long_description=long_description, 37 | classifiers=classifiers, 38 | keywords='bottle boilerplate startproject doc', 39 | author="Thiago Avelino", 40 | author_email="thiago@avelino.xxx", 41 | url=url, 42 | download_url="{0}/tarball/master".format(url), 43 | license="MIT", 44 | install_requires=REQUIREMENTS, 45 | entry_points={ 46 | 'console_scripts': ["bottle-boilerplate = bottle_boilerplate:main"] 47 | }, 48 | py_modules=['bottle_boilerplate'], 49 | scripts=['bottle_boilerplate.py'], 50 | include_package_data=True, 51 | zip_safe=False) 52 | --------------------------------------------------------------------------------