diff --git a/COPYRIGHT b/COPYRIGHT index 465132c2..5593b795 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -All original work is copyright (c) 2006-2013 Chad Whitacre and contributors, +All original work is copyright (c) 2006-2016 Chad Whitacre and contributors, all rights reserved, and is released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a diff --git a/Changelog.md b/Changelog.md index 7f4c596a..9a159ff7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,322 +1,2 @@ -Aspen.py Changelog +aspen.py Changelog ================== - -0.42 - Released Thu Sept 10 2015 by @whit537 --------------------------------------------- - -* the repo is now named `aspen.py` instead of `aspen-python` (#485) - -* extend the test client to support file uploads (#508) - -* speclines are no longer required in simplates (#296) - -* upgrade mimeparse, ahead of porting to Python 3 (#500) - -* add a website.colorize_tracebacks option (#501) - -* drop support for Python 2.6 (#497) - -* refactor simplates internally ahead of splitting them out (#481) - -* port to Windows (#482) - -* protect against URL redirection attacks (#471) - - -0.41 - Released Thu Jul 2 2015 by @whit537 ------------------------------------------- - -* fix a regression in simplate scoping introduced in 0.38 (#463) - - -0.40 - Released Mon Jun 29 2015 by @whit537 -------------------------------------------- - -* fix a regression in aspen.wsgi introduced in 0.39 (#460) - - -0.39 - Released Mon Jun 29 2015 by @whit537 -------------------------------------------- - -* fix two security bugs related to CRLF injection - https://github.com/gratipay/security-qf35us/issues/1 - -* remove argv-based configuration; Website now takes kwargs instead (#455) - -* remove exec-based configuration, i.e., configure-aspen.py (#373); use kwargs - to Website or environment variables instead - -* add a base_url configuration setting and use it in a new algorithm - function, redirect_to_base_url (#457) - -* improve the redirect API: it's now at website.redirect instead of - request.redirect; it honors the new website.base_url; and it takes an - optional response object (#458) - - -0.38 - Released Tue Jun 23 2015 by @pjz ---------------------------------------- - -* refactor aspen.__main__ into aspen.serve() - -* alias 'website' as 'application' in aspen.wsgi to better support some WSGI servers - -* finish removing request.fs since we now have state['dispatch_result'].match - -* update dependencies - -* Add an autosphinx target to help sphinx migration - -* prevent simplate locals from implictly leaking into `state` (#427) (Thanks Changaco!) - -0.37 - Released Wed Feb 18 2015 by @pjz ---------------------------------------- - -* Fix some return types during error handling (#406, #398) - -* Make simplates a bit more separate from Aspen (#412) - -* Use algorithm state as request context - -* Make convenience aliases in request context read-only (#414) - -* Generate html test coverage report (Thanks Changaco!) - -* Python 3 fixes to build.py and fabricate.py (Thanks Changaco!) - -0.36 - Released Mon Dec 15 2014 by @pjz ---------------------------------------- - -* Don't return a 415 when the body is empty (Thanks @Changaco!) - -* Simplify the simplate class hierarchy - -* Don't show scary tracebacks when pygments is missing (#268) - -* Let custom typecasters access global state. (#395) - -0.35 - Released Thu Oct 30 2014 by @whit537 -------------------------------------------- - -* Fixes a bug in error handling (#393) - -* Restores request.context (#392) - -* Introduces a dispatch_result object (#389) - -* Refactors the dispatcher (#389) - -* Removes the request.fs attribute (#389) - -* Removes the request.website attribute (#385) - -* Makes the Canonizer utility more configurable (#382) - -* Refactors request body parsing (#377) - -* Removes `thrash` utility (#376) - -* Adds support for PORT envvar to `python -m aspen` (#356) - -* Fixes a bug in header parsing (#369) - -0.34 - Released Tue Jul 29 2014 by @pjz ---------------------------------------- - -* Finally fix the dispatcher to fully work with .spt files - -* Add a data-driven test suite for the dispatcher - -* Add a jsonp_dump renderer - -0.33 - Released Tue Jul 8 2014 by @whit537 -------------------------------------------- - -* Cleans up implicit casting to unicode in headers (#364) - -* Fixes regression w/ request bodies in test client (#360) - -* Fixes bug in request logging during exception handling (#291) - -* Fixes to the aspen.io site - -0.32 - Released Mon May 12 2014 by @pjz ---------------------------------------- - -* Fixes to the aspen.io site (Thanks @BigBlueHat!) - -* Make HTTP dates always end in GMT (Thanks @Changaco!) - -* Clean up error.spt a bit wrt pygmentation and show_traceback interactions - -0.31 - Released Tue May 6 2014 by @pjz ---------------------------------------- - -* Aspen server is gone! Aspen is now a pure-WSGI app! - ...well, okay, for dev purposes it'll run under wsgiref via - python -m aspen - -* Socket.IO support is gone! ..but not forgotten. We'll get it - back someday, when there's a sane way to do so. - -* The datapath is now much more unicode-clean - -* Simplate files can now specify their encodings - -* Tweaks to work better under windows (thanks @BigBlueHat!) - -* Documentation is moving toward Sphinx! - -* JSON support was moved into a renderer. It's no longer a special - simplate type. - -0.30 - Released Wed Mar 19 2014 by @pjz ---------------------------------------- - -* Fix traceback handling - thanks @Changaco - -* Fix #267 - 404 on requests for .spt files - -0.29 - Released Mon Feb 17 2014 by @pjz ---------------------------------------- - -* Only support negotiated simplates for errors - this simplifies the error path - -* Update packaging tools and packages to be somewhat modern (thanks @Ivoz!) - -0.28.3 - Released Thu Jan 9 2014 by @whit537 ---------------------------------------------- - -* Fix bug where we were preventing tracebacks from reaching either the console - or the browser. - -* Return 400 from anti-CRLF-injection instead of 500 - -0.28.2 - Released Sat Jan 4 2014 by @pjz ------------------------------------------ - -* Fix bug in aspen.testing.pytest_fixtures required to be fixed for - aspen-python-plugins tests to work - -0.28.1 - Released Thu Dec 19 2013 by @whit537 ---------------------------------------------- - -* Fix regressions in server.py exception handling - -0.28 - Released Thu Dec 19 2013 by @pjz ------------------------------------------ - -* Update to a newer version of Algorithm - -* Started using standalone filesystem_tree module - -* Clean up test harness and test client to be more usable - -* Add extensible typecasting for virtual path segments - -0.27 - Released Tue Nov 26 2013 by @pjz ------------------------------------------ - -* Major internal refactoring to use Algorithm and py.test with fixtures - -* Much-improved aspen TestClient and use it for aspen's own tests - -* Switch hook filters to be algorithm/flow filters - -* fixed #250 - 500 if file is treated as a path - -* fixed #242 - Rename UnicodeWithParams to PathParts - -0.26.1 - Released Wed Oct 2 2013 by @pjz ----------------------------------------- - -* fixed a bug in unicode handling that broke cookies - -* Allow rendered json simplates to specify per-file content-types (Thanks @ArmstrongJ!) - -* Fix #232 - doc server doesn't start - by updating doc/README with current instructions - -0.26 - Released Fri Sep 27 by @pjz ----------------------------------- - -* Fixed #226 - converted from nosetests to py.test - this got us much - nicer assert handling for debugging. - -* Fixed #225 - added 'from future' imports to the whole thing to 1) prep - for py3k and 2) help fix unicode handling (Thanks @nejstastnejsistene !) - -* Fixed #42 - added support for rfc2396 key/value pairs in URLs (tl;dr is - that /foo;a=b;a=c;d=e/ will go to /foo/ with an easy way to get the values - of a (==['b','c']) and d (==['e']) - -* Added some CRLF-injection protection (Thanks Berkay Aydin!) - -* Added module entrypoint to allow 'python -m aspen.server' (Thanks @jaraco !) - -* Fixed #165 - make it explicit which variables are available to templates - By default all variables are available. If you want to limit that, put - the list of variable names in `__all__` - - -0.25.3 - Released 2013-08-09 by @whit537 ----------------------------------------- - -* Fixed #212 - don't wrongly swallow IOError in configure-aspen.py - -* Fixed #210 - better error message for negotiated simplate with not enough - pages - -* Fixed #209 - tracebacks for raise Response are scary - - -0.25.2 - Released 2013-07-22 by @whit537 ----------------------------------------- - -* Fixed #207 - we shouldn't strict_parse request bodies - - -0.25.1 - Released 2013-06-21 by @pjz ------------------------------------- - -A fairly minor release... unless you were hit by one of the now-fixed bugs: - -* Fixed #195 - qs drops URL Encoded + and & signs - -* Fixed #196 - hangs w/ gevent on Ctrl-C - -* Changed redirects to be less-permanent 302s instead of 301s - -* Fixed issue #175 - redirect default index files to / ; - Makes URLs prettier! - -* Fix configuration parser list-parsing bug discovered while fixing #175. - The configuration parser was preserving empty-string items in its - parsing of comma-separated lists. - -* Fixed the heroku config (used for the aspen.io site) to explicitly require - aspen-tornado since it's no longer installed by default - - -0.25.0 - Released 2013-06-14 by @pjz ------------------------------------- - -* The major change in this release is that renderers and network engines - have both been moved to external modules. This means that dependencies - for aspen are now much better defined, as the plugins (aspen-* on PyPi) - are essentially a small bit of glue code and a 'requires' on the external - dependency, instead of the previous state where all the glue code was - internal to the 'aspen' package and there was no 'requires' anywhere to - say which version the glue was for. - -* The other major change was the dropping of python 2.5 support - it just - got too troublesome. Aspen now support python 2.[67] only. - -* Much work was done to make aspen's build system better. - -* WSGI Middleware should now work correctly - thanks dhalia! - -* New pygmentized default error simplates - thanks AlexisHuet! - -* Oh, and as of now we're going to try and keep up a Changelog! - - diff --git a/MANIFEST.in b/MANIFEST.in index 0a10d2e7..4c9751f3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ +include COPYRIGHT include ez_setup.py include version.txt -include aspen/configuration/mime.types -graft aspen/www +include aspen/request_processor/mime.types diff --git a/README.rst b/README.rst index 163540ae..5ca39493 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,8 @@ -Aspen is a Python web framework. Simplates are the main attraction. +Aspen is a filesystem router for Python web frameworks. See `aspen.io`_ for +framework wrappers. + +.. _aspen_io: http://aspen.io/ + Installation, Testing, and License ================================== @@ -14,20 +18,11 @@ And we test against 32- and 64-bit Python 2.7 on Windows: |appveyor| ``aspen`` is MIT-licensed. -.. _GitHub: https://github.com/gratipay/aspen.py +.. _GitHub: https://github.com/AspenWeb/aspen.py .. _PyPI: https://pypi.python.org/pypi/aspen -.. |travis| image:: https://img.shields.io/travis/gratipay/aspen.py/master.svg - :target: https://travis-ci.org/gratipay/aspen.py +.. |travis| image:: https://img.shields.io/travis/AspenWeb/aspen.py/master.svg + :target: https://travis-ci.org/AspenWeb/aspen.py :alt: Linux build status -.. |appveyor| image:: https://img.shields.io/appveyor/ci/gratipay/aspen-py/master.svg - :target: https://ci.appveyor.com/project/gratipay/aspen-py +.. |appveyor| image:: https://img.shields.io/appveyor/ci/AspenWeb/aspen-py/master.svg + :target: https://ci.appveyor.com/project/AspenWeb/aspen-py :alt: Windows build status - - -Documentation and further information -===================================== - -on the main `site`_ : http://aspen.io/ - -.. _site: http://aspen.io/ - diff --git a/aspen/__init__.py b/aspen/__init__.py index 643bc58e..76780126 100644 --- a/aspen/__init__.py +++ b/aspen/__init__.py @@ -1,69 +1,8 @@ -"""This is Aspen, a dynamic Jekyll for Python. - - -Installation ------------- - -:py:mod:`aspen` is available on `GitHub`_ and on `PyPI`_:: - - $ pip install aspen - -We `test `_ against Python 2.7. - -:py:mod:`aspen` is in `MIT-licensed`_. - -.. _github: https://github.com/gittip/aspen-python -.. _pypi: https://pypi.python.org/pypi/aspen -.. _MIT-licensed: http://opensource.org/licenses/MIT - - -Quick Start ------------ - -Given: `POSIX `_ -and `virtualenv `_ - -Step 1: Make a sandbox: - - $ virtualenv foo - $ cd foo - $ . bin/activate - :: - -Step 2: Install `aspen from PyPI `_: - - (foo)$ pip install aspen - blah - blah - blah - :: - -Step 3: Create a website root: - - (foo)$ mkdir www - (foo)$ cd www - :: - -Step 4: Create a web page, and start aspen inside it: - - (foo)$ echo Greetings, program! > index.html.spt - (foo)$ aspen - Greetings, program! Welcome to port 8080. - :: - -Step 5: Check `localhost http://localhost:8080`_ for your new page! - - .. image:: greetings-program.png - -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys -import pkg_resources -dist = pkg_resources.get_distribution('aspen') -__version__ = dist.version WINDOWS = sys.platform[:3] == 'win' diff --git a/aspen/backcompat.py b/aspen/backcompat.py index b7029695..7ed3c7eb 100644 --- a/aspen/backcompat.py +++ b/aspen/backcompat.py @@ -1,7 +1,3 @@ -""" -aspen.backcompat -++++++++++++++++ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/exceptions.py b/aspen/exceptions.py index a561595c..625d1c06 100644 --- a/aspen/exceptions.py +++ b/aspen/exceptions.py @@ -1,9 +1,3 @@ -""" -aspen.exceptions -++++++++++++++++ - -Exceptions used by Aspen -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/http/__init__.py b/aspen/http/__init__.py index 0d9d76f2..e69de29b 100644 --- a/aspen/http/__init__.py +++ b/aspen/http/__init__.py @@ -1,8 +0,0 @@ -""" -aspen.http -++++++++++ -""" -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals diff --git a/aspen/http/mapping.py b/aspen/http/mapping.py index 1de4fcfe..0dd3c047 100644 --- a/aspen/http/mapping.py +++ b/aspen/http/mapping.py @@ -1,7 +1,3 @@ -""" -aspen.http.mapping -~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/http/request.py b/aspen/http/request.py index 6c10a1ac..2ff64266 100644 --- a/aspen/http/request.py +++ b/aspen/http/request.py @@ -25,9 +25,6 @@ def __new__(cls, value, params): class Path(Mapping): """Represent the path of a resource. - - This is populated by aspen.gauntlet.virtual_paths. - """ def __init__(self, raw): diff --git a/aspen/request_processor/__init__.py b/aspen/request_processor/__init__.py index 97b44baf..acde3a9b 100644 --- a/aspen/request_processor/__init__.py +++ b/aspen/request_processor/__init__.py @@ -1,7 +1,3 @@ -""" -aspen.request_processor -+++++++++++++++++++++++ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/request_processor/algorithm.py b/aspen/request_processor/algorithm.py index 557b7711..0d70186e 100644 --- a/aspen/request_processor/algorithm.py +++ b/aspen/request_processor/algorithm.py @@ -1,7 +1,4 @@ """ -aspen.algorithm -~~~~~~~~~~~~~~~ - These functions comprise the request processing functionality of Aspen. The order of functions in this module defines Aspen algorithm for request diff --git a/aspen/request_processor/dispatcher.py b/aspen/request_processor/dispatcher.py index 6f92550a..741d1a23 100644 --- a/aspen/request_processor/dispatcher.py +++ b/aspen/request_processor/dispatcher.py @@ -1,7 +1,4 @@ """ -aspen.dispatcher -++++++++++++++++ - Implement Aspen's filesystem dispatch algorithm. """ from __future__ import absolute_import diff --git a/aspen/request_processor/parse.py b/aspen/request_processor/parse.py index 79007dcb..51a46748 100644 --- a/aspen/request_processor/parse.py +++ b/aspen/request_processor/parse.py @@ -1,7 +1,4 @@ """ -aspen.configuration.parse -~~~~~~~~~~~~~~~~~~~~~~~~~ - Define parser/validators for configuration system Each of these is guaranteed to be passed a unicode object as read from the diff --git a/aspen/request_processor/typecasting.py b/aspen/request_processor/typecasting.py index cc80a274..20f90c98 100644 --- a/aspen/request_processor/typecasting.py +++ b/aspen/request_processor/typecasting.py @@ -1,9 +1,5 @@ """ -aspen.typecasting -+++++++++++++++++ - Pluggable typecasting of virtual path values - """ from __future__ import absolute_import from __future__ import division diff --git a/aspen/resources.py b/aspen/resources.py index 99ea5d4a..c3712e5b 100644 --- a/aspen/resources.py +++ b/aspen/resources.py @@ -1,7 +1,4 @@ """ -aspen.resources -+++++++++++++++ - This is a registry of filesystem paths to objects representing HTTP resources. Use :py:func:`get` to use the cache, use :py:func:`load` to circumvent it. diff --git a/aspen/simplates/json_.py b/aspen/simplates/json_.py index 9795eeed..cd757a62 100644 --- a/aspen/simplates/json_.py +++ b/aspen/simplates/json_.py @@ -1,7 +1,3 @@ -""" -aspen.json -++++++++++ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/pagination.py b/aspen/simplates/pagination.py index b55f775c..ab4da720 100644 --- a/aspen/simplates/pagination.py +++ b/aspen/simplates/pagination.py @@ -1,7 +1,3 @@ -""" -aspen.resources.pagination -~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/renderers/__init__.py b/aspen/simplates/renderers/__init__.py index b48584c0..18eacb38 100644 --- a/aspen/simplates/renderers/__init__.py +++ b/aspen/simplates/renderers/__init__.py @@ -1,9 +1,6 @@ """ -aspen.simplates.renderers -+++++++++++++++++++++++++ - This module implements pluggable content rendering. - # + See user docs here: http://aspen.io/simplates/rendered/ @@ -14,23 +11,23 @@ Template resources derive their media type from the file extension. Negotiated resources have no file extension by definition, so they specify the media type of their content pages in the resource itself, on the so-called "specline" of -each content page, like so: +each content page, like so:: - ^L - ^L text/plain + [---] + [---] text/plain Greetings, program! - ^L text/html + [---] text/html

Greetings, program!

A Renderer is instantiated by a Factory, which is a class that is itself -instantied with one argument: +instantied with one argument:: configuration an Aspen configuration object Instances of each Renderer subclass are callables that take five arguments and -return a function (confused yet?). The five arguments are: +return a function (confused yet?). The five arguments are:: factory the Factory creating this object filepath the filesystem path of the resource in question @@ -43,7 +40,7 @@ returns a bytestring of rendered content. The heavy lifting is done in the render_content method. -Here's how to implement and register your own renderer: +Here's how to implement and register your own renderer:: from aspen.simplates.renderers import Renderer, Factory @@ -58,13 +55,13 @@ class CheeseFactory(Factory): Put that in your startup script. Now you can use it in a negotiated or rendered -resource: +resource:: - ^L #!excited-about-cheese + [---] via excited-about-cheese I like cheese! -Out will come: +Out will come:: I like CHEESE!!!!!!! @@ -160,7 +157,7 @@ def compile(self, filepath, raw): def render_content(self, context): """Override. Context is a dict. - You can use these attributes: + You can use these attributes:: self.raw the raw bytes of the content page self.compiled the result of self.compile (generally a template in diff --git a/aspen/simplates/renderers/json_dump.py b/aspen/simplates/renderers/json_dump.py index 727a352a..fad1b0e4 100644 --- a/aspen/simplates/renderers/json_dump.py +++ b/aspen/simplates/renderers/json_dump.py @@ -1,7 +1,3 @@ -""" -aspen.simplates.renderers.json_dump -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/renderers/jsonp_dump.py b/aspen/simplates/renderers/jsonp_dump.py index aee3c126..ff716a23 100644 --- a/aspen/simplates/renderers/jsonp_dump.py +++ b/aspen/simplates/renderers/jsonp_dump.py @@ -1,7 +1,3 @@ -""" -aspen.simplates.renderers.jsonp_dump -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/renderers/stdlib_format.py b/aspen/simplates/renderers/stdlib_format.py index 2ddb4fc3..50213a8d 100644 --- a/aspen/simplates/renderers/stdlib_format.py +++ b/aspen/simplates/renderers/stdlib_format.py @@ -1,7 +1,3 @@ -""" -aspen.simplates.renderers.stdlib_format -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/renderers/stdlib_percent.py b/aspen/simplates/renderers/stdlib_percent.py index 947e56d5..ea46ae0c 100644 --- a/aspen/simplates/renderers/stdlib_percent.py +++ b/aspen/simplates/renderers/stdlib_percent.py @@ -1,7 +1,3 @@ -""" -aspen.simplates.renderers.stdlib_percent -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/renderers/stdlib_template.py b/aspen/simplates/renderers/stdlib_template.py index 286e8102..686bf68d 100644 --- a/aspen/simplates/renderers/stdlib_template.py +++ b/aspen/simplates/renderers/stdlib_template.py @@ -1,7 +1,3 @@ -""" -aspen.simplates.renderers.stdlib_template -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/simplates/simplate.py b/aspen/simplates/simplate.py index 1da9caf3..b864f9fe 100644 --- a/aspen/simplates/simplate.py +++ b/aspen/simplates/simplate.py @@ -1,7 +1,3 @@ -""" -aspen.resources.dynamic_resource -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -150,12 +146,12 @@ def best_match(self, accept, default=None): def render(self, accept, context): """ - get the response to a request for this page + Get the response to a request for this page:: - accept - an HTTP Accept: header asking for this page - context - a dict of execution context values you wish to supply - * Note that these are overriden by values that are carried - over from the execution of the zeroth page + accept - an HTTP Accept: header asking for this page + context - a dict of execution context values you wish to supply + * Note that these are overriden by values that are carried + over from the execution of the zeroth page """ # copy the state dict to avoid accidentally mutating it @@ -184,7 +180,7 @@ def parse_into_pages(self, decoded): If there's one page, it's a template. If there's more than one page, the first page is always python and the last is always a template. - If there's more than two pages, the second page is python _unless it has a specline_, which makes it a template + If there's more than two pages, the second page is python *unless it has a specline*, which makes it a template """ diff --git a/aspen/testing.py b/aspen/testing.py index 9c249490..dc4e6db7 100644 --- a/aspen/testing.py +++ b/aspen/testing.py @@ -1,7 +1,3 @@ -""" -aspen.testing -+++++++++++++ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function diff --git a/aspen/utils.py b/aspen/utils.py index 8893c8cb..9c0574ea 100644 --- a/aspen/utils.py +++ b/aspen/utils.py @@ -1,7 +1,3 @@ -""" -aspen.utils -+++++++++++ -""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -76,7 +72,7 @@ def by_regex(regex_tuples, default=True): requested URI, then the flow is applied or not based on if filter? is True or False. - For example: + For example:: from aspen.flows.filter import by_regex diff --git a/docs/conf.py b/docs/conf.py index 44b9b3f3..a08f9f42 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,15 +1,11 @@ # -*- coding: utf-8 -*- # -# Aspen documentation build configuration file, created by +# Aspen documentation build configuration file, originally created by # sphinx-quickstart on Mon Feb 24 15:00:43 2014. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is exec()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. +# Note that not all possible configuration values are present in this file. import sys, os @@ -18,73 +14,43 @@ # 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' +# -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig' +] # 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'Aspen' -copyright = u'2014, Chad Whitacre, Paul Jimenez, and others' +copyright = u'2016, Chad Whitacre, Paul Jimenez, and others' -# 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. -# -# The short X.Y version. -version = '0.29' # The full version, including alpha/beta/rc tags. -release = '0.29' - -# 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' +release = open('../version.txt').read().strip() +# The short X.Y version. +version = release.split('-', 1)[0] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] -# 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 = [] + +# -- Autodoc options + +autodoc_default_flags = ['members', 'undoc-members'] +autodoc_member_order = 'bysource' # -- Options for HTML output --------------------------------------------------- @@ -93,93 +59,12 @@ # 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 -# " v 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 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 = 'Aspendoc' # -- 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 = [ @@ -187,26 +72,6 @@ u'Chad Whitacre, Paul Jimenez, and others', '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 -------------------------------------------- @@ -217,9 +82,6 @@ [u'Chad Whitacre, Paul Jimenez, and others'], 1) ] -# If true, show URL addresses after external links. -#man_show_urls = False - # -- Options for Texinfo output ------------------------------------------------ @@ -228,19 +90,11 @@ # dir menu entry, description, category) texinfo_documents = [ ('index', 'Aspen', u'Aspen Documentation', - u'Chad Whitacre, Paul Jimenez, and others', 'Aspen', 'One line description of project.', + u'Chad Whitacre, Paul Jimenez, and others', 'Aspen', + 'A filesystem router for Python web frameworks.', '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' - # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/docs/index.rst b/docs/index.rst index 4021d95c..c870db83 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,196 +1,95 @@ -Aspen -===== +************ +aspen module +************ .. automodule:: aspen - :members: - :member-order: bysource - :special-members: - - -Library Reference ------------------ - -.. automodule:: aspen.algorithms - :members: - :member-order: bysource - :special-members: -.. automodule:: aspen.algorithms.website - :members: - :member-order: bysource - :special-members: +backcompat +========== .. automodule:: aspen.backcompat - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.configuration - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.configuration.exceptions - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.configuration.options - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.configuration.parse - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.context - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.dispatcher - :members: - :member-order: bysource - :special-members: + +exceptions +========== .. automodule:: aspen.exceptions - :members: - :member-order: bysource - :special-members: + +http +==== .. automodule:: aspen.http - :members: - :member-order: bysource - :special-members: -.. automodule:: aspen.http.baseheaders - :members: - :member-order: bysource - :special-members: +mapping +------- .. automodule:: aspen.http.mapping - :members: - :member-order: bysource - :special-members: + +request +------- .. automodule:: aspen.http.request - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.http.response - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.json_ - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.logging - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.renderers - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.renderers.json_dump - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.renderers.stdlib_format - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.renderers.stdlib_percent - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.renderers.stdlib_template - :members: - :member-order: bysource - :special-members: + +request_processor +================= + +.. automodule:: aspen.request_processor + +algorithm +--------- + +.. automodule:: aspen.request_processor.algorithm + +dispatcher +---------- + +.. automodule:: aspen.request_processor.dispatcher + +parse +----- + +.. automodule:: aspen.request_processor.parse + +typecasting +----------- + +.. automodule:: aspen.request_processor.typecasting + +resources +========= .. automodule:: aspen.resources - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.dynamic_resource - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.negotiated_resource - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.pagination - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.rendered_resource - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.resource - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.resources.static_resource - :members: - :member-order: bysource - :special-members: + +simplates +========= + +.. automodule:: aspen.simplates + +json_ +----- + +.. automodule:: aspen.simplates.json_ + +pagination +---------- + +.. automodule:: aspen.simplates.pagination + +simplate +-------- + +.. automodule:: aspen.simplates.simplate + +renderers +--------- + +.. automodule:: aspen.simplates.renderers + +testing +======= .. automodule:: aspen.testing - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.testing.client - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.testing.harness - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.testing.pytest_fixtures - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.typecasting - :members: - :member-order: bysource - :special-members: + +utils +===== .. automodule:: aspen.utils - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.website - :members: - :member-order: bysource - :special-members: - -.. automodule:: aspen.wsgi - :members: - :member-order: bysource - :special-members: diff --git a/release.sh b/release.sh index ad2b418e..0700225a 100755 --- a/release.sh +++ b/release.sh @@ -34,7 +34,7 @@ else echo "Go do that first." exit 1 fi - confirm "Tag version $1 and upload to PyPI and push to github and heroku?" + confirm "Tag version $1 and upload to PyPI and push to github?" if [ $? -eq 0 ]; then printf "$1" > version.txt git commit version.txt -m"Release $1" @@ -49,7 +49,6 @@ else printf "\055dev" >> version.txt git commit version.txt -m"Bump version to $1-dev" git push - git push heroku rm -rf dist fi diff --git a/setup.py b/setup.py index dc6b4917..f7b9a560 100644 --- a/setup.py +++ b/setup.py @@ -22,17 +22,16 @@ , 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application' ] -setup( author = 'Gratipay, LLC' - , author_email = 'support@gratipay.com' +setup( author = 'Chad Whitacre et al.' + , author_email = 'team@aspen.io' , classifiers = classifiers - , description = ('Aspen is a Python web framework. ' - 'Simplates are the main attraction.') + , description = 'A filesystem router for Python web frameworks' , name = 'aspen' - , packages = find_packages(exclude=['aspen.tests', 'aspen.tests.*']) - , url = 'http://aspen.io/' + , packages = find_packages() + , url = 'https://github.com/AspenWeb/aspen.py' , version = version , zip_safe = False - , package_data = {'aspen': ['configuration/mime.types']} + , package_data = {'aspen': ['request_processor/mime.types']} , install_requires = ASPEN_DEPS , tests_require = TEST_DEPS )