Merge pull request #622 from meejah/issue621-docs

fix autodoc asyncio/twisted
This commit is contained in:
Tobias Oberstein
2016-03-31 23:44:00 +02:00
3 changed files with 317 additions and 277 deletions

View File

@@ -5,7 +5,24 @@
Changelog Changelog
========= =========
0.12.0 0.13.0
------
`Published 2016-03-15 <https://pypi.python.org/pypi/autobahn/0.13.0>`_
* fix: better traceback logging (`#613 <https://github.com/crossbario/autobahn-python/pull/613>`_)
* fix: unicode handling in debug messages (`#606 <https://github.com/crossbario/autobahn-python/pull/606>`_)
* fix: return Deferred from ``run()`` (`#603 <https://github.com/crossbario/autobahn-python/pull/603>`_).
* fix: more debug logging improvements
* fix: more `Pattern` tests, fix edge case (`#592 <https://github.com/crossbario/autobahn-python/pull/592>`_).
* fix: better logging from ``asyncio`` ApplicationRunner
* new: ``disclose`` becomes a strict router-side feature (`#586 <https://github.com/crossbario/autobahn-python/issues/586>`_).
* new: subscriber black/whitelisting using authid/authrole
* new: asyncio websocket testee
* new: refine Observable API (`#593 <https://github.com/crossbario/autobahn-python/pull/593>`_).
0.12.1
------ ------
`Published 2016-01-30 <https://pypi.python.org/pypi/autobahn/0.12.0>`__ `Published 2016-01-30 <https://pypi.python.org/pypi/autobahn/0.12.0>`__

View File

@@ -1,275 +1,298 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import sys import sys
import sphinx_bootstrap_theme import sphinx_bootstrap_theme
# only needed for Autobahn|Python # only needed for Autobahn|Python
sys.path.insert(0, os.path.abspath('./_extensions')) sys.path.insert(0, os.path.abspath('./_extensions'))
sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('..'))
extensions = [ # monkey-patch txaio so that we can "use" both twisted *and* asyncio,
'sphinx.ext.autodoc', # at least at import time -- this is so the autodoc stuff can
'sphinx.ext.doctest', # successfully import autobahn.twisted.* as well as autobahn.asyncio.*
'sphinx.ext.intersphinx', # (usually, you can only import one or the other in a single Python
'sphinx.ext.viewcode', # interpreter)
'sphinx.ext.ifconfig',
'sphinx.ext.todo', if True:
'sphinxcontrib.spelling', import txaio
'txsphinx' # only needed for Autobahn|Python
] def use_tx():
"monkey-patched for doc-building"
spelling_lang = 'en_US' from txaio import tx
spelling_show_suggestions = False txaio._use_framework(tx)
spelling_word_list_filename = 'spelling_wordlist.txt'
def use_aio():
# Add any paths that contain templates here, relative to this directory. "monkey-patched for doc-building"
templates_path = ['_templates'] from txaio import aio
txaio._use_framework(aio)
# The suffix of source filenames.
source_suffix = '.rst' txaio.use_twisted = use_tx
txaio.use_asyncio = use_aio
# The master toctree document.
master_doc = 'index'
extensions = [
# General information about the project. 'sphinx.ext.autodoc',
project = u'AutobahnPython' 'sphinx.ext.doctest',
copyright = u'Tavendo GmbH' 'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
# The version info for the project you're documenting, acts as replacement for 'sphinx.ext.ifconfig',
# |version| and |release|, also used in various other places throughout the 'sphinx.ext.todo',
# built documents. 'sphinxcontrib.spelling',
# 'txsphinx' # only needed for Autobahn|Python
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) ]
init = {}
with open(os.path.join(base_dir, "autobahn", "__init__.py")) as f: spelling_lang = 'en_US'
exec(f.read(), init) spelling_show_suggestions = False
spelling_word_list_filename = 'spelling_wordlist.txt'
version = release = init["__version__"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # The suffix of source filenames.
#language = None source_suffix = '.rst'
# There are two options for replacing |today|: either, you set today to some # The master toctree document.
# non-false value, then it is used: master_doc = 'index'
#today = ''
# Else, today_fmt is used as the format for a strftime call. # General information about the project.
#today_fmt = '%B %d, %Y' project = u'AutobahnPython'
copyright = u'Tavendo GmbH'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # The version info for the project you're documenting, acts as replacement for
exclude_patterns = ['_build', 'work'] # |version| and |release|, also used in various other places throughout the
# built documents.
# The name of the Pygments (syntax highlighting) style to use. #
pygments_style = 'sphinx' base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
init = {}
## Sphinx-Bootstrap Theme with open(os.path.join(base_dir, "autobahn", "__init__.py")) as f:
## exec(f.read(), init)
## http://sphinx-bootstrap-theme.readthedocs.org/en/latest/README.html
## version = release = init["__version__"]
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# The language for content autogenerated by Sphinx. Refer to documentation
html_theme_options = { # for a list of supported languages.
# Navigation bar title. (Default: ``project`` value) #language = None
'navbar_title': " ",
# There are two options for replacing |today|: either, you set today to some
# Tab name for entire site. (Default: "Site") # non-false value, then it is used:
'navbar_site_name': "Site", #today = ''
# Else, today_fmt is used as the format for a strftime call.
# A list of tuples containing pages or urls to link to. #today_fmt = '%B %d, %Y'
# Valid tuples should be in the following forms:
# (name, page) # a link to a page # List of patterns, relative to source directory, that match files and
# (name, "/aa/bb", 1) # a link to an arbitrary relative url # directories to ignore when looking for source files.
# (name, "http://example.com", True) # arbitrary absolute url exclude_patterns = ['_build', 'work']
# Note the "1" or "True" value above as the third argument to indicate
# an arbitrary url. # The name of the Pygments (syntax highlighting) style to use.
'navbar_links': [ pygments_style = 'sphinx'
#("Examples", "examples"),
#("Link", "http://example.com", True), ## Sphinx-Bootstrap Theme
], ##
## http://sphinx-bootstrap-theme.readthedocs.org/en/latest/README.html
# Render the next and previous page links in navbar. (Default: true) ##
'navbar_sidebarrel': True, html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# Render the current pages TOC in the navbar. (Default: true)
'navbar_pagenav': True, html_theme_options = {
# Navigation bar title. (Default: ``project`` value)
# Tab name for the current pages TOC. (Default: "Page") 'navbar_title': " ",
#'navbar_pagenav_name': "Page",
# Tab name for entire site. (Default: "Site")
# Global TOC depth for "site" navbar tab. (Default: 1) 'navbar_site_name': "Site",
# Switching to -1 shows all levels.
'globaltoc_depth': 1, # A list of tuples containing pages or urls to link to.
# Valid tuples should be in the following forms:
# Include hidden TOCs in Site navbar? # (name, page) # a link to a page
# # (name, "/aa/bb", 1) # a link to an arbitrary relative url
# Note: If this is "false", you cannot have mixed ``:hidden:`` and # (name, "http://example.com", True) # arbitrary absolute url
# non-hidden ``toctree`` directives in the same page, or else the build # Note the "1" or "True" value above as the third argument to indicate
# will break. # an arbitrary url.
# 'navbar_links': [
# Values: "true" (default) or "false" #("Examples", "examples"),
'globaltoc_includehidden': "true", #("Link", "http://example.com", True),
],
# HTML navbar class (Default: "navbar") to attach to <div> element.
# For black navbar, do "navbar navbar-inverse" # Render the next and previous page links in navbar. (Default: true)
#'navbar_class': "navbar navbar-inverse", 'navbar_sidebarrel': True,
'navbar_class': "navbar",
# Render the current pages TOC in the navbar. (Default: true)
# Fix navigation bar to top of page? 'navbar_pagenav': True,
# Values: "true" (default) or "false"
'navbar_fixed_top': "true", # Tab name for the current pages TOC. (Default: "Page")
#'navbar_pagenav_name': "Page",
# Location of link to source.
# Options are "nav" (default), "footer" or anything else to exclude. # Global TOC depth for "site" navbar tab. (Default: 1)
'source_link_position': "nav", # Switching to -1 shows all levels.
'globaltoc_depth': 1,
# Bootswatch (http://bootswatch.com/) theme.
# # Include hidden TOCs in Site navbar?
# Options are nothing with "" (default) or the name of a valid theme #
# such as "amelia" or "cosmo". # Note: If this is "false", you cannot have mixed ``:hidden:`` and
'bootswatch_theme': "", # non-hidden ``toctree`` directives in the same page, or else the build
# will break.
# Choose Bootstrap version. #
# Values: "3" (default) or "2" (in quotes) # Values: "true" (default) or "false"
'bootstrap_version': "3", 'globaltoc_includehidden': "true",
}
# HTML navbar class (Default: "navbar") to attach to <div> element.
# Add any paths that contain custom themes here, relative to this directory. # For black navbar, do "navbar navbar-inverse"
#html_theme_path = [] #'navbar_class': "navbar navbar-inverse",
'navbar_class': "navbar",
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # Fix navigation bar to top of page?
#html_title = None # Values: "true" (default) or "false"
'navbar_fixed_top': "true",
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None # Location of link to source.
# Options are "nav" (default), "footer" or anything else to exclude.
# The name of an image file (relative to this directory) to place at the top 'source_link_position': "nav",
# of the sidebar.
#html_logo = None # Bootswatch (http://bootswatch.com/) theme.
#
# The name of an image file (within the static path) to use as favicon of the # Options are nothing with "" (default) or the name of a valid theme
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # such as "amelia" or "cosmo".
# pixels large. 'bootswatch_theme': "",
#html_favicon = None
# Choose Bootstrap version.
# Add any paths that contain custom static files (such as style sheets) here, # Values: "3" (default) or "2" (in quotes)
# relative to this directory. They are copied after the builtin static files, 'bootstrap_version': "3",
# so a file named "default.css" will overwrite the builtin "default.css". }
html_static_path = ['_static']
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
## additional variables which become accessible in RST (e.g. .. ifconfig:: not no_network)
## # The name for this set of Sphinx documents. If None, it defaults to
def setup(app): # "<project> v<release> documentation".
app.add_config_value('no_network', False, True) #html_title = None
no_network = None # A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
## additional variables which become accessible in the template engine's
## context for all pages # The name of an image file (relative to this directory) to place at the top
## # of the sidebar.
html_context = { #html_logo = None
#'widgeturl': 'https://demo.crossbar.io/clandeckwidget'
#'widgeturl': 'http://127.0.0.1:8090/widget' # The name of an image file (within the static path) to use as favicon of the
'widgeturl': None, # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
'no_network': False, # pixels large.
#'cstatic': 'http://127.0.0.1:8888', #html_favicon = None
'cstatic': '//tavendo-common-static.s3-eu-west-1.amazonaws.com',
} # 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,
# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24). # so a file named "default.css" will overwrite the builtin "default.css".
# Path should be relative to the ``_static`` files directory. html_static_path = ['_static']
html_logo = None
## additional variables which become accessible in RST (e.g. .. ifconfig:: not no_network)
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, ##
# using the given strftime format. def setup(app):
#html_last_updated_fmt = '%b %d, %Y' app.add_config_value('no_network', False, True)
# If true, SmartyPants will be used to convert quotes and dashes to no_network = None
# typographically correct entities.
#html_use_smartypants = True ## additional variables which become accessible in the template engine's
## context for all pages
# Custom sidebar templates, maps document names to template names. ##
html_sidebars = { html_context = {
'**': [ #'widgeturl': 'https://demo.crossbar.io/clandeckwidget'
'side-primary.html' #'widgeturl': 'http://127.0.0.1:8090/widget'
] 'widgeturl': None,
} 'no_network': False,
#'cstatic': 'http://127.0.0.1:8888',
# Additional templates that should be rendered to pages, maps page names to 'cstatic': '//tavendo-common-static.s3-eu-west-1.amazonaws.com',
# template names. }
#html_additional_pages = {}
# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24).
# If false, no module index is generated. # Path should be relative to the ``_static`` files directory.
#html_domain_indices = True html_logo = None
# If false, no index is generated.
#html_use_index = True # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# If true, the index is split into individual pages for each letter. #html_last_updated_fmt = '%b %d, %Y'
#html_split_index = False
# If true, SmartyPants will be used to convert quotes and dashes to
# If true, links to the reST sources are added to the pages. # typographically correct entities.
#html_show_sourcelink = True #html_use_smartypants = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # Custom sidebar templates, maps document names to template names.
#html_show_sphinx = True html_sidebars = {
'**': [
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 'side-primary.html'
#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 # Additional templates that should be rendered to pages, maps page names to
# base URL from which the finished HTML is served. # template names.
#html_use_opensearch = '' #html_additional_pages = {}
# This is the file name suffix for HTML files (e.g. ".xhtml"). # If false, no module index is generated.
#html_file_suffix = None #html_domain_indices = True
# Output file base name for HTML help builder. # If false, no index is generated.
htmlhelp_basename = 'AutobahnPython' #html_use_index = True
# If true, the index is split into individual pages for each letter.
# http://sphinx-doc.org/ext/intersphinx.html #html_split_index = False
intersphinx_mapping = {
'py2': ('http://docs.python.org/2', None), # If true, links to the reST sources are added to the pages.
'py3': ('http://docs.python.org/3', None), #html_show_sourcelink = True
'six': ('https://pythonhosted.org/six/', None),
} # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
rst_epilog = """
.. |ab| replace:: Autobahn # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
.. |Ab| replace:: **Autobahn** #html_show_copyright = True
.. |abL| replace:: Autobahn|Python
.. |AbL| replace:: **Autobahn**\|Python # If true, an OpenSearch description file will be output, and all pages will
.. _Autobahn: http://autobahn.ws # contain a <link> tag referring to it. The value of this option must be the
.. _AutobahnJS: http://autobahn.ws/js # base URL from which the finished HTML is served.
.. _AutobahnPython: **Autobahn**\|Python #html_use_opensearch = ''
.. _WebSocket: http://tools.ietf.org/html/rfc6455
.. _RFC6455: http://tools.ietf.org/html/rfc6455 # This is the file name suffix for HTML files (e.g. ".xhtml").
.. _WAMP: http://wamp.ws/ #html_file_suffix = None
.. _Twisted: http://twistedmatrix.com/
.. _asyncio: http://docs.python.org/3.4/library/asyncio.html # Output file base name for HTML help builder.
.. _CPython: http://python.org/ htmlhelp_basename = 'AutobahnPython'
.. _PyPy: http://pypy.org/
.. _Jython: http://jython.org/
.. _WAMP: http://wamp.ws/ # http://sphinx-doc.org/ext/intersphinx.html
.. _WAMPv1: http://wamp.ws/spec/wamp1/ intersphinx_mapping = {
.. _WAMPv2: https://github.com/wamp-proto/wamp-proto/blob/master/spec/README.md 'py2': ('http://docs.python.org/2', None),
.. _AutobahnTestsuite: http://autobahn.ws/testsuite 'py3': ('http://docs.python.org/3', None),
.. _trollius: https://pypi.python.org/pypi/trollius/ 'six': ('https://pythonhosted.org/six/', None),
.. _tulip: https://pypi.python.org/pypi/asyncio/ }
"""
rst_epilog = """
rst_prolog = """ .. |ab| replace:: Autobahn
""" .. |Ab| replace:: **Autobahn**
.. |abL| replace:: Autobahn|Python
# http://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method .. |AbL| replace:: **Autobahn**\|Python
autoclass_content = 'both' .. _Autobahn: http://autobahn.ws
.. _AutobahnJS: http://autobahn.ws/js
autodoc_member_order = 'bysource' .. _AutobahnPython: **Autobahn**\|Python
.. _WebSocket: http://tools.ietf.org/html/rfc6455
.. _RFC6455: http://tools.ietf.org/html/rfc6455
.. _WAMP: http://wamp.ws/
.. _Twisted: http://twistedmatrix.com/
.. _asyncio: http://docs.python.org/3.4/library/asyncio.html
.. _CPython: http://python.org/
.. _PyPy: http://pypy.org/
.. _Jython: http://jython.org/
.. _WAMP: http://wamp.ws/
.. _WAMPv1: http://wamp.ws/spec/wamp1/
.. _WAMPv2: https://github.com/wamp-proto/wamp-proto/blob/master/spec/README.md
.. _AutobahnTestsuite: http://autobahn.ws/testsuite
.. _trollius: https://pypi.python.org/pypi/trollius/
.. _tulip: https://pypi.python.org/pypi/asyncio/
"""
rst_prolog = """
"""
# http://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method
autoclass_content = 'both'
autodoc_member_order = 'bysource'

View File

@@ -3,7 +3,7 @@
*Open-source (MIT) real-time framework for Web, Mobile & Internet of Things.* *Open-source (MIT) real-time framework for Web, Mobile & Internet of Things.*
Latest release: v\ |version| (:ref:`Changelog`) Latest release: v\ |version| (:ref:`changelog`)
.. ifconfig:: not no_network .. ifconfig:: not no_network