Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Inversion #3

Closed
wants to merge 8 commits into from

2 participants

@willkg
Collaborator

There's still a few things I want to do:

  1. Write tests for buchner stuff, but we have to make sure the project-template tests don't get picked up. Also, we need a separate requirements file for buchner development.
  2. Ditch the fabfile -- we can fold the functionality into manage.py.
  3. Document buchner project-template structure, how to do basic things and the buchner helpers.
  4. Rewrite cmdline.py to use subparsers rather than the silly handler stuff I wrote.
  5. Look at alembic more and possibly switch to that.

Anyhow, this gets us pretty far and works right now. I think I want to do the rest as separate things. Figured getting this done in one big chunk makes it less likely my work blocks you (or others).

r?

willkg added some commits
@willkg willkg Invert buchner
This moves the bulk of buchner into project-template.

Note: This doesn't work, yet.
2b06235
@willkg willkg Create buchner-cmd
This creates buchner-cmd and reworks the project-template code
accordingly.
bc8df76
@willkg willkg Update README 3d1d99e
@willkg willkg Fix relpath problem
The relpath call here was returning nothing and that caused problems.
We don't need it, so I nixed it.
b4f2ce4
@willkg willkg Fix apps loading; add basic templates
* Apps should be loaded by python module without any magic. Otherwise
  the magic causes problems for apps not in the project.
* Add basic templates for base, sample/index, 404 and 500. Now you
  can create the project and runserver and stuff shows up.
13992c1
@willkg willkg Update README with runserver info 3f7027f
@willkg willkg Switch to use buchner helpers 50e3bcb
@willkg willkg Add test scaffolding for buchner 560c598
@willkg
Collaborator

I added another commit that adds tests for buchner. ^^^

@rehandalal
Owner

Thanks!

@rehandalal rehandalal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2013
  1. @willkg

    Invert buchner

    willkg authored
    This moves the bulk of buchner into project-template.
    
    Note: This doesn't work, yet.
  2. @willkg

    Create buchner-cmd

    willkg authored
    This creates buchner-cmd and reworks the project-template code
    accordingly.
  3. @willkg

    Update README

    willkg authored
Commits on Apr 1, 2013
  1. @willkg

    Fix relpath problem

    willkg authored
    The relpath call here was returning nothing and that caused problems.
    We don't need it, so I nixed it.
  2. @willkg

    Fix apps loading; add basic templates

    willkg authored
    * Apps should be loaded by python module without any magic. Otherwise
      the magic causes problems for apps not in the project.
    * Add basic templates for base, sample/index, 404 and 500. Now you
      can create the project and runserver and stuff shows up.
  3. @willkg
  4. @willkg

    Switch to use buchner helpers

    willkg authored
Commits on Apr 3, 2013
  1. @willkg
This page is out of date. Refresh to see the latest.
Showing with 811 additions and 55 deletions.
  1. +1 −4 .gitignore
  2. +0 −1  Procfile
  3. +65 −0 README.rst
  4. +10 −0 bin/buchner-cmd
  5. +2 −0  buchner/__init__.py
  6. +0 −9 buchner/apps/sample/views.py
  7. +149 −0 buchner/cmdline.py
  8. +0 −5 buchner/database/__init__.py
  9. 0  { → buchner/project-template}/Buildfile
  10. +3 −0  buchner/project-template/CONTRIBUTORS
  11. +1 −0  buchner/project-template/LICENSE
  12. 0  {migrations/versions → buchner/project-template/PROJECTMODULE}/__init__.py
  13. 0  {migrations → buchner/project-template/PROJECTMODULE/apps}/__init__.py
  14. 0  buchner/{ → project-template/PROJECTMODULE}/apps/sample/__init__.py
  15. +2 −1  buchner/{ → project-template/PROJECTMODULE}/apps/sample/models.py
  16. +9 −0 buchner/project-template/PROJECTMODULE/apps/sample/templates/sample/index.html
  17. +10 −0 buchner/project-template/PROJECTMODULE/apps/sample/views.py
  18. 0  buchner/{ → project-template/PROJECTMODULE}/bundles.py
  19. +5 −0 buchner/project-template/PROJECTMODULE/database/__init__.py
  20. 0  buchner/{ → project-template/PROJECTMODULE}/database/classes.py
  21. 0  buchner/{ → project-template/PROJECTMODULE}/database/helpers.py
  22. 0  buchner/{ → project-template/PROJECTMODULE}/errors.py
  23. +5 −20 buchner/{ → project-template/PROJECTMODULE}/main.py
  24. 0  { → buchner/project-template/PROJECTMODULE}/migrations/README
  25. 0  buchner/{apps → project-template/PROJECTMODULE/migrations}/__init__.py
  26. +1 −1  { → buchner/project-template/PROJECTMODULE}/migrations/migrate.cfg
  27. 0  buchner/{templates/errors/base.html → project-template/PROJECTMODULE/migrations/versions/__init__.py}
  28. +4 −2 buchner/{ → project-template/PROJECTMODULE}/settings.py
  29. 0  buchner/{ → project-template/PROJECTMODULE}/settings_local.py-dist
  30. +1 −1  buchner/{ → project-template/PROJECTMODULE}/settings_test.py
  31. +10 −0 buchner/project-template/PROJECTMODULE/templates/base.html
  32. +5 −0 buchner/project-template/PROJECTMODULE/templates/errors/404.html
  33. +5 −0 buchner/project-template/PROJECTMODULE/templates/errors/500.html
  34. +1 −0  buchner/project-template/PROJECTMODULE/templates/errors/base.html
  35. 0  buchner/{templates/errors/500.html → project-template/PROJECTMODULE/tests/__init__.py}
  36. +5 −0 buchner/project-template/PROJECTMODULE/wsgi.py
  37. +1 −0  buchner/project-template/Procfile
  38. +26 −0 buchner/project-template/README.rst
  39. 0  { → buchner/project-template}/bin/yuicompressor-2.4.7.jar
  40. 0  { → buchner/project-template}/fabfile.py
  41. +2 −5 { → buchner/project-template}/manage.py
  42. +1 −1  { → buchner/project-template}/node.json
  43. +2 −1  { → buchner/project-template}/requirements.txt
  44. 0  buchner/templates/base.html
  45. 0  buchner/templates/errors/404.html
  46. +1 −0  buchner/tests/__init__.py
  47. +20 −0 buchner/tests/test_helpers.py
  48. +0 −4 buchner/wsgi.py
  49. +153 −0 docs/Makefile
  50. +240 −0 docs/conf.py
  51. +22 −0 docs/index.rst
  52. +2 −0  nose.cfg
  53. +2 −0  requirements-dev.txt
  54. +45 −0 setup.py
View
5 .gitignore
@@ -1,6 +1,3 @@
*.py[co]
-settings_local.py
-
-node_modules/
-docs/_build
+docs/_build
View
1  Procfile
@@ -1 +0,0 @@
-web: gunicorn standup.wsgi:app -b 0.0.0.0:$PORT -w 3
View
65 README.rst
@@ -2,3 +2,68 @@ Büchner
=======
A boilerplate for larger, modular Flask applications.
+
+:code: https://github.com/rehandalal/buchner/
+:issues: https://github.com/rehandalal/buchner/issues
+:license: BSD 3-clause
+:documentation: http://buchner.rtfd.org/
+
+
+Requirements
+============
+
+* Python 2.7
+
+
+Install
+=======
+
+Install it with pip::
+
+ $ pip install buchner
+
+
+Install it from source::
+
+ $ git clone git://github.com/rehandalal/buchner
+ $ cd buchner
+ $ python setup.py install
+
+
+Install it for hacking on::
+
+ $ git clone git://github.com/rehandalal/buchner
+ $ cd buchner
+ $ python setup.py develop
+
+
+Create a project
+================
+
+Once you have it installed, you can create a new project::
+
+ $ buchner-cmd createproject <PROJECTNAME>
+
+
+It'll create the project skeleton in the current working directory. You
+can run your project immediately::
+
+ $ cd <PROJECTMODULE>
+ $ mkvirtualenv
+ $ pip install -r requirements.txt
+ $ python manage.py runserver
+
+ Open browser and view http://127.0.0.1:5000/
+
+
+Run tests
+=========
+
+You need to install the development requirements::
+
+ $ pip install -r requirements-dev.txt
+
+
+After that, you can run tests with::
+
+ nosetests
View
10 bin/buchner-cmd
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+from buchner.cmdline import cmdline_handler
+
+
+if __name__ == '__main__':
+ sys.exit(cmdline_handler("buchner-cmd", sys.argv[1:]))
View
2  buchner/__init__.py
@@ -0,0 +1,2 @@
+__version__ = '0.1.dev'
+__releasedate__ = ''
View
9 buchner/apps/sample/views.py
@@ -1,9 +0,0 @@
-from flask import Blueprint, render_template
-
-
-blueprint = Blueprint(__name__, 'sample')
-
-
-@blueprint.route('/')
-def index():
- return render_template('index.html')
View
149 buchner/cmdline.py
@@ -0,0 +1,149 @@
+import os
+import os.path
+import string
+from optparse import OptionParser
+
+
+from buchner import __version__
+
+
+USAGE = '%prog [options] [command] [command-options]'
+VERSION = '%prog ' + __version__
+
+
+def build_parser(usage):
+ parser = OptionParser(usage=usage, version=VERSION)
+
+ return parser
+
+
+DIGIT_TO_WORD = {
+ '0': 'zero',
+ '1': 'one',
+ '2': 'two',
+ '3': 'three',
+ '4': 'four',
+ '5': 'five',
+ '6': 'six',
+ '7': 'seven',
+ '8': 'eight',
+ '9': 'nine'
+ }
+
+
+def clean_project_module(s):
+ s = ''.join([char for char in s
+ if char in string.ascii_letters + string.digits])
+
+ if s[0] in string.digits:
+ s = DIGIT_TO_WORD[s[0]] + s[1:]
+
+ return s
+
+
+def perror(s):
+ print s
+
+
+def create_project(command, argv):
+ parser = build_parser('%prog createproject <PROJECTNAME>')
+ (options, args) = parser.parse_args()
+
+ if not argv:
+ perror('ERROR: You must provide a project name.')
+ return 1
+
+ project_name = args[1]
+ project_module = clean_project_module(project_name.lower())
+
+ # Ask them for project module name and then double-check it's
+ # valid.
+ new_project_module = raw_input(
+ 'Python module name for your project: [{0}] '.format(project_module))
+ new_project_module = new_project_module.strip()
+ if not new_project_module:
+ new_project_module = project_module
+
+ if new_project_module != clean_project_module(new_project_module):
+ perror(
+ 'ERROR: "{0}" is not a valid Python module name.'.format(
+ new_project_module))
+ return 1
+
+ project_module = new_project_module
+ project_dir = os.path.abspath(project_module)
+
+ if os.path.exists(project_dir):
+ perror(
+ 'ERROR: Cannot create "{0}"--something is in the way.'.format(
+ project_dir))
+ return 1
+
+ # Walk the project-template and create all files and directories
+ # replacing:
+ #
+ # * PROJECTMODULE -> project_module
+
+ project_template_dir = os.path.join(os.path.dirname(__file__),
+ 'project-template')
+
+ for root, dirs, files in os.walk(project_template_dir):
+ rel_root = root[len(project_template_dir)+1:]
+
+ for f in files:
+ source = os.path.join(root, f)
+ dest = os.path.join(project_dir, rel_root, f)
+ dest = dest.replace('PROJECTMODULE', project_module)
+
+ if not os.path.exists(os.path.dirname(dest)):
+ os.makedirs(os.path.dirname(dest))
+
+ fp = open(source, 'rb')
+ data = fp.read()
+ fp.close()
+
+ data = data.replace('PROJECTMODULE', project_module)
+
+ fp = open(dest, 'wb')
+ fp.write(data)
+ fp.close()
+
+ print 'create file: {0}'.format(dest)
+
+ print 'Done!'
+ return 0
+
+
+HANDLERS = (
+ ('createproject', create_project, 'Creates a new buchner project.'),
+ )
+
+
+def cmdline_handler(scriptname, argv):
+ print '%s version %s' % (scriptname, __version__)
+
+ # TODO: Rewrite using subparsers.
+ handlers = HANDLERS
+
+ if not argv or '-h' in argv or '--help' in argv:
+ parser = build_parser("%prog [command]")
+ parser.print_help()
+ print ''
+ print 'Commands:'
+ for command_str, _, command_help in handlers:
+ print ' %-14s %s' % (command_str, command_help)
+ return 0
+
+ if '--version' in argv:
+ # We've already printed the version, so we can just exit.
+ return 0
+
+ command = argv.pop(0)
+ for (cmd, fun, hlp) in handlers:
+ if cmd == command:
+ return fun(command, argv)
+
+ perror('Command "{0}" does not exist.'.format(command))
+ for cmd, fun, hlp in handlers:
+ perror(' %-14s %s' % (cmd, hlp))
+ return 1
View
5 buchner/database/__init__.py
@@ -1,5 +0,0 @@
-from standup.database import classes, helpers
-from standup.database.helpers import get_session
-
-
-__all__ = ['classes', 'helpers', 'get_session']
View
0  Buildfile → buchner/project-template/Buildfile
File renamed without changes
View
3  buchner/project-template/CONTRIBUTORS
@@ -0,0 +1,3 @@
+Contributors
+============
+
View
1  buchner/project-template/LICENSE
@@ -0,0 +1 @@
+TODO: Pick a license and copy and paste text here.
View
0  migrations/versions/__init__.py → buchner/project-template/PROJECTMODULE/__init__.py
File renamed without changes
View
0  migrations/__init__.py → ...r/project-template/PROJECTMODULE/apps/__init__.py
File renamed without changes
View
0  buchner/apps/sample/__init__.py → ...ct-template/PROJECTMODULE/apps/sample/__init__.py
File renamed without changes
View
3  buchner/apps/sample/models.py → ...ject-template/PROJECTMODULE/apps/sample/models.py
@@ -1,6 +1,7 @@
-from buchner.database.classes import Model
from sqlalchemy import Column, Integer
+from PROJECTMODULE.database.classes import Model
+
class Sample(Model):
__tablename__ = 'sample'
View
9 buchner/project-template/PROJECTMODULE/apps/sample/templates/sample/index.html
@@ -0,0 +1,9 @@
+{% extends "base.html" %}
+{% block title %}Sample Home{% endblock title %}
+
+{% block content %}
+<h1>Sample home</h1>
+<p>
+ This is the index.html page of the sample app.
+</p>
+{% endblock content %}
View
10 buchner/project-template/PROJECTMODULE/apps/sample/views.py
@@ -0,0 +1,10 @@
+from flask import Blueprint, render_template
+
+
+blueprint = Blueprint('sample', __name__,
+ template_folder='templates')
+
+
+@blueprint.route('/')
+def index():
+ return render_template('sample/index.html')
View
0  buchner/bundles.py → buchner/project-template/PROJECTMODULE/bundles.py
File renamed without changes
View
5 buchner/project-template/PROJECTMODULE/database/__init__.py
@@ -0,0 +1,5 @@
+from PROJECTMODULE.database import classes, helpers
+from PROJECTMODULE.database.helpers import get_session
+
+
+__all__ = ['classes', 'helpers', 'get_session']
View
0  buchner/database/classes.py → ...roject-template/PROJECTMODULE/database/classes.py
File renamed without changes
View
0  buchner/database/helpers.py → ...roject-template/PROJECTMODULE/database/helpers.py
File renamed without changes
View
0  buchner/errors.py → buchner/project-template/PROJECTMODULE/errors.py
File renamed without changes
View
25 buchner/main.py → buchner/project-template/PROJECTMODULE/main.py
@@ -4,21 +4,7 @@
from flask.ext.funnel import Funnel
from flask.ext.mobility import Mobility
-from buchner.errors import register_error_handlers
-
-
-def _get_apps_full_names(apps):
- names = []
- for app in apps:
- parts = []
- if not __name__ == '__main__':
- parts = __name__.split('.')
- parts.pop()
- parts.append('apps')
- parts.append(app)
-
- names.append('.'.join(parts))
- return names
+from PROJECTMODULE.errors import register_error_handlers
def create_app(settings):
@@ -34,18 +20,17 @@ def create_app(settings):
# Bootstrapping
if 'INSTALLED_APPS' in app.config:
- app.installed_apps = _get_apps_full_names(
- app.config.get('INSTALLED_APPS'))
+ app.installed_apps = app.config.get('INSTALLED_APPS', [])
# Extensions
Funnel(app)
Mobility(app)
# Register blueprints
- for a in app.installed_apps:
- # Register blueprints
+ for app_path in app.installed_apps:
app.register_blueprint(
- getattr(__import__('%s.views' % a, fromlist=['blueprint']),
+ getattr(__import__('{0}.views'.format(app_path),
+ fromlist=['blueprint']),
'blueprint'))
# Register error handlers
View
0  migrations/README → .../project-template/PROJECTMODULE/migrations/README
File renamed without changes
View
0  buchner/apps/__init__.py → ...ect-template/PROJECTMODULE/migrations/__init__.py
File renamed without changes
View
2  migrations/migrate.cfg → ...ect-template/PROJECTMODULE/migrations/migrate.cfg
@@ -1,7 +1,7 @@
[db_settings]
# Used to identify which repository this database is versioned under.
# You can use the name of your project.
-repository_id=buchner
+repository_id=PROJECTMODULE
# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.
View
0  buchner/templates/errors/base.html → ...ate/PROJECTMODULE/migrations/versions/__init__.py
File renamed without changes
View
6 buchner/settings.py → buchner/project-template/PROJECTMODULE/settings.py
@@ -9,9 +9,11 @@ def abspath(path):
DEBUG = truthiness(os.environ.get('DEBUG', False))
-DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:///buchner_app.db')
+DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:///PROJECTMODULE_app.db')
-INSTALLED_APPS = []
+INSTALLED_APPS = [
+ 'PROJECTMODULE.apps.sample'
+]
# Flask-Funnel
JAVA_BIN = os.environ.get('JAVA_BIN', 'java')
View
0  buchner/settings_local.py-dist → ...ect-template/PROJECTMODULE/settings_local.py-dist
File renamed without changes
View
2  buchner/settings_test.py → ...r/project-template/PROJECTMODULE/settings_test.py
@@ -1,4 +1,4 @@
-from buchner.settings import *
+from PROJECTMODULE.settings import *
TESTING = True
View
10 buchner/project-template/PROJECTMODULE/templates/base.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>{% block title %}{% endblock title %}</title>
+</head>
+<body>
+{% block content %}
+{% endblock content %}
+</body>
+</html>
View
5 buchner/project-template/PROJECTMODULE/templates/errors/404.html
@@ -0,0 +1,5 @@
+{% extends "errors/base.html" %}
+{% block title %}HTTP 404{% endblock title %}
+{% block content %}
+<h1>HTTP 404: Page does not exist</h1>
+{% endblock content %}
View
5 buchner/project-template/PROJECTMODULE/templates/errors/500.html
@@ -0,0 +1,5 @@
+{% extends "errors/500.html" %}
+{% block title %}HTTP 500{% endblock title %}
+{% block content %}
+<h1>HTTP 500</h1>
+{% endblock content %}
View
1  buchner/project-template/PROJECTMODULE/templates/errors/base.html
@@ -0,0 +1 @@
+{% extends "base.html" %}
View
0  buchner/templates/errors/500.html → .../project-template/PROJECTMODULE/tests/__init__.py
File renamed without changes
View
5 buchner/project-template/PROJECTMODULE/wsgi.py
@@ -0,0 +1,5 @@
+from PROJECTMODULE import settings
+from PROJECTMODULE.main import create_app
+
+
+app = create_app(settings)
View
1  buchner/project-template/Procfile
@@ -0,0 +1 @@
+web: gunicorn PROJECTMODULE.wsgi:app -b 0.0.0.0:$PORT -w 3
View
26 buchner/project-template/README.rst
@@ -0,0 +1,26 @@
+========
+ README
+========
+
+Summary
+=======
+
+
+Install and configure
+=====================
+
+
+Run server
+==========
+
+Run::
+
+ $ python manage.py runserver
+
+
+Run tests
+=========
+
+Run::
+
+ $ nosetests
View
0  bin/yuicompressor-2.4.7.jar → buchner/project-template/bin/yuicompressor-2.4.7.jar
File renamed without changes
View
0  fabfile.py → buchner/project-template/fabfile.py
File renamed without changes
View
7 manage.py → buchner/project-template/manage.py
@@ -7,7 +7,7 @@
from migrate.exceptions import DatabaseAlreadyControlledError
from migrate.versioning import api as migrate_api
-from buchner.wsgi import app
+from PROJECTMODULE.wsgi import app
manager = Manager(app)
@@ -15,10 +15,7 @@
# Add the Flask-Funnel manager as a submanager
manager.add_command('funnel', funnel_manager)
-app_path = os.path.join(
- os.path.relpath(os.path.dirname(__file__), os.getcwd()),
- 'buchner')
-
+app_path = os.path.join(os.path.dirname(__file__), 'PROJECTMODULE')
db_repo = os.path.join(app_path, 'migrations')
db_url = app.config.get('DATABASE_URL')
View
2  node.json → buchner/project-template/node.json
@@ -1,5 +1,5 @@
{
- "name": "buchner",
+ "name": "PROJECTMODULE",
"version": "0.0.0",
"dependencies": {
"less": "1.3.3"
View
3  requirements.txt → buchner/project-template/requirements.txt
@@ -3,8 +3,9 @@ Flask==0.9
Flask-Funnel==0.1.2
Flask-Mobility==0.1
Flask-Script==0.5.3
-gunicorn==0.14.5
nose==1.2.1
SQLAlchemy==0.7.10
sqlalchemy-migrate==0.7.2
WTForms==1.0.3
+
+gunicorn==0.14.5
View
0  buchner/templates/base.html
No changes.
View
0  buchner/templates/errors/404.html
No changes.
View
1  buchner/tests/__init__.py
@@ -0,0 +1 @@
+
View
20 buchner/tests/test_helpers.py
@@ -0,0 +1,20 @@
+from nose.tools import eq_
+
+
+from buchner.helpers import json_requested, jsonify, truthiness
+
+
+def test_truthiness():
+ for s in ('t', 'true', 'TRUE', '1'):
+ eq_(truthiness(s), True)
+
+ for s in ('f', 'false', 'FALSE', '0'):
+ eq_(truthiness(s), False)
+
+ # TODO: Test funky data
+
+
+# TODO: Test jsonify
+
+
+# TODO: Test json_requested
View
4 buchner/wsgi.py
@@ -1,4 +0,0 @@
-from buchner import settings
-from buchner.main import create_app
-
-app = create_app(settings)
View
153 docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/buchner.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/buchner.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/buchner"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/buchner"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
View
240 docs/conf.py
@@ -0,0 +1,240 @@
+# -*- coding: utf-8 -*-
+#
+# buchner documentation build configuration file, created by
+# sphinx-quickstart on Sun Mar 31 14:35:13 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'buchner'
+copyright = u'2013, Rehan Dalal'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+from buchner import __version__
+version = __version__
+release = __version__
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'buchnerdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'buchner.tex', u'buchner Documentation',
+ u'Rehan Dalal', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'buchner', u'buchner Documentation',
+ [u'Rehan Dalal'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'buchner', u'buchner Documentation',
+ u'Rehan Dalal', 'buchner', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
View
22 docs/index.rst
@@ -0,0 +1,22 @@
+.. buchner documentation master file, created by
+ sphinx-quickstart on Sun Mar 31 14:35:13 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to buchner's documentation!
+===================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
View
2  nose.cfg
@@ -0,0 +1,2 @@
+[nosetests]
+ignore-files=project-template
View
2  requirements-dev.txt
@@ -0,0 +1,2 @@
+Flask
+nose
View
45 setup.py
@@ -0,0 +1,45 @@
+from setuptools import setup, find_packages
+import re
+import os
+
+
+READMEFILE = 'README.rst'
+VERSIONFILE = os.path.join('buchner', '__init__.py')
+VSRE = r"""^__version__ = ['"]([^'"]*)['"]"""
+
+
+def get_version():
+ verstrline = open(VERSIONFILE, 'rt').read()
+ mo = re.search(VSRE, verstrline, re.M)
+ if mo:
+ return mo.group(1)
+ else:
+ raise RuntimeError(
+ 'Unable to find version string in {0}.'.format(VERSIONFILE))
+
+
+setup(
+ name='buchner',
+ version=get_version(),
+ author='Rehan Dalal',
+ author_email='rehandalal@gmail.com',
+ description='Flask project template and helper library',
+ long_description=open(READMEFILE).read(),
+ url='https://github.com/rehandalal/buchner',
+ license='BSD',
+ zip_safe=False,
+ scripts=["bin/buchner-cmd"],
+ packages=find_packages(),
+ include_package_data=True,
+ install_requires=[],
+ test_suite='nose.collector',
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'License :: OSI Approved :: MIT License'
+ 'Operating System :: POSIX :: Linux',
+ 'Operating System :: MacOS :: MacOS X',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.7',
+ ]
+)
Something went wrong with that request. Please try again.