mirror of
https://github.com/sprockets/sprockets.mixins.mediatype.git
synced 2024-11-21 19:28:38 +00:00
Update docs
- Update and isoldate doc dependencies - Simplify sphinx config - Treat warnings as errors - Remove redundant self.finish() from examples
This commit is contained in:
parent
b26998a912
commit
b2e980d04d
7 changed files with 7 additions and 12 deletions
|
@ -89,13 +89,11 @@ request handlers.
|
|||
class SomeHandler(content.ContentMixin, web.RequestHandler):
|
||||
def get(self):
|
||||
self.send_response({'data': 'value'})
|
||||
self.finish()
|
||||
|
||||
def post(self):
|
||||
body = self.get_request_body()
|
||||
# do whatever
|
||||
self.send_response({'action': 'performed'})
|
||||
self.finish()
|
||||
|
||||
Based on the settings stored in the ``Application`` instance and the HTTP
|
||||
headers, the request and response data will be handled correctly or the
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import alabaster
|
||||
from sprockets.mixins.mediatype import __version__
|
||||
|
||||
needs_sphinx = '1.0'
|
||||
|
@ -6,18 +5,14 @@ extensions = ['sphinx.ext.autodoc',
|
|||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinxcontrib.autohttp.tornado']
|
||||
source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
project = 'sprockets.mixins.mediatype'
|
||||
copyright = '2015-2016, AWeber Communications'
|
||||
release = __version__
|
||||
version = '.'.join(release.split('.')[0:1])
|
||||
|
||||
pygments_style = 'sphinx'
|
||||
html_theme = 'alabaster'
|
||||
html_style = 'custom.css'
|
||||
html_static_path = ['static']
|
||||
html_theme_path = [alabaster.get_path()]
|
||||
html_sidebars = {
|
||||
'**': ['about.html', 'navigation.html'],
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ class SimpleHandler(content.ContentMixin, web.RequestHandler):
|
|||
body = self.get_request_body()
|
||||
self.set_status(200)
|
||||
self.send_response(body)
|
||||
self.finish()
|
||||
|
||||
|
||||
def make_application(**settings):
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
-r docs.txt
|
||||
-r testing.txt
|
||||
-r installation.txt
|
||||
-e .[msgpack]
|
||||
sphinx>=1.2,<2
|
||||
sphinxcontrib-httpdomain>=1.3,<2
|
||||
|
|
2
requires/docs.txt
Normal file
2
requires/docs.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
sphinx==1.8.2
|
||||
sphinxcontrib-httpdomain==1.7.0
|
|
@ -1,6 +1,10 @@
|
|||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[build_sphinx]
|
||||
fresh-env = 1
|
||||
warning-is-error = 1
|
||||
|
||||
[nosetests]
|
||||
cover-branches = 1
|
||||
cover-erase = 1
|
||||
|
|
|
@ -75,7 +75,6 @@ class ContentSettings(object):
|
|||
response_body = settings['application/msgpack'].to_bytes(
|
||||
response_dict, encoding='utf-8')
|
||||
self.write(response_body)
|
||||
self.finish()
|
||||
|
||||
def make_application():
|
||||
app = web.Application([web.url('/', SomeHandler)])
|
||||
|
@ -288,7 +287,6 @@ class ContentMixin(object):
|
|||
body = self.get_request_body()
|
||||
# do stuff --> response_dict
|
||||
self.send_response(response_dict)
|
||||
self.finish()
|
||||
|
||||
:meth:`get_request_body` will deserialize the request data into
|
||||
a dictionary based on the :http:header:`Content-Type` request
|
||||
|
|
Loading…
Reference in a new issue