sphinxcontrib-asyncio-0.2.0/0000775000175000017500000000000012704132422016707 5ustar travistravis00000000000000sphinxcontrib-asyncio-0.2.0/docs/0000775000175000017500000000000012704132422017637 5ustar travistravis00000000000000sphinxcontrib-asyncio-0.2.0/docs/Makefile0000664000175000017500000001704412704132373021312 0ustar travistravis00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # 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 help: @echo "Please use \`make ' where 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 " applehelp to make an Apple Help Book" @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 " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @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 " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp 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." .PHONY: qthelp 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/sphinxcontrib-asyncio.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sphinxcontrib-asyncio.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/sphinxcontrib-asyncio" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sphinxcontrib-asyncio" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: latex 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)." .PHONY: latexpdf 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." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo 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)." .PHONY: info 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." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck 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." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." sphinxcontrib-asyncio-0.2.0/docs/autodoc_example.py0000664000175000017500000000037212704132373023371 0ustar travistravis00000000000000import asyncio class MyClass: def my_func(self): """ Normal function """ @asyncio.coroutine def my_coro(self): """ This is my coroutine """ @asyncio.coroutine def coro(param): """ Module level async function """ sphinxcontrib-asyncio-0.2.0/docs/conf.py0000664000175000017500000001766612704132373021163 0ustar travistravis00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # sphinxcontrib-asyncio documentation build configuration file, created by # sphinx-quickstart on Fri Mar 4 23:56:21 2016. # # 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 codecs import os import re import sys # 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(os.path.join(__file__, '../'))) _docs_path = os.path.dirname(__file__) _version_path = os.path.abspath(os.path.join(_docs_path, '..', 'sphinxcontrib', 'asyncio.py')) with codecs.open(_version_path, 'r', 'latin1') as fp: try: _version_info = re.search(r"^__version__ = '" r"(?P\d+)" r"\.(?P\d+)" r"\.(?P\d+)" r"(?P.*)?'$", fp.read(), re.M).groupdict() except IndexError: raise RuntimeError('Unable to determine version.') sys.path.append('..') # -- 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 = [ 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinxcontrib.asyncio', ] intersphinx_mapping = { 'python': ('http://docs.python.org/3', None) } # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] 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 = 'sphinxcontrib-asyncio' copyright = '2016, Andrew Svetlov' author = 'Andrew Svetlov' # 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 = '{major}.{minor}'.format(**_version_info) # The full version, including alpha/beta/rc tags. release = '{major}.{minor}.{patch}-{tag}'.format(**_version_info) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. 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 = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- 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 = 'alabaster' # 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'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # 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 # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' # html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value # html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. # html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'sphinxcontrib-asynciodoc' autodoc_member_order = 'bysource' add_module_names = False sphinxcontrib-asyncio-0.2.0/docs/index.rst0000664000175000017500000001016212704132373021505 0ustar travistravis00000000000000.. sphinxcontrib-asyncio documentation master file, created by sphinx-quickstart on Fri Mar 4 23:56:21 2016. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. default-domain:: py sphinxcontrib-asyncio ===================== Add :ref:`coroutine` markup support to sphinx-based docs. .. _GitHub: https://github.com/aio-libs/sphinxcontrib-asyncio Installation ------------ 1. Install from PyPI:: $ pip install sphinxcontrib-asyncio 2. Enable ``sphinxcontrib-asyncio`` extension in your ``conf.py``:: extensions = ['sphinxcontrib.asyncio'] Usage In Documents ------------------ Use ``cofunction`` instead of ``function``:: .. cofunction:: coro(a, b) Simple coroutine function. .. cofunction:: coro(a, b) Simple coroutine function. and ``comethod`` instead of ``method``:: .. class:: A .. comethod:: meth(self, param) Coroutine method. .. class:: A .. comethod:: meth(self, param) Coroutine method. For more complex markup use *directive options*, e.g. ``async-with`` for *asynchronous context managers factories*:: .. cofunction:: open_url(param) :async-with: A function that returns asynchronous context manager. .. cofunction:: open_url(param) :async-with: A function that returns asynchronous context manager. That means ``open_url`` can be used as:: async with open_url(arg) as cm: pass ``async-for`` may be used for *asynchronous generator* markup:: .. cofunction:: iter_vals(arg) :async-for: A function the returns asynchronous generator. .. cofunction:: iter_vals(arg) :async-for: A function the returns asynchronous generator. ``iter_vals()`` can be used as:: async for item in iter_args(arg): pass By default ``async-for`` and ``async-with`` suppresses ``coroutine``. If both ``await func()`` and ``async with func():`` are allowed (func is both *coroutine* and *asynchronous context manager*) explicit **coroutine** flag:: .. cofunction:: get(url) :async-with: :coroutine: A function can be used in ``async with`` and ``await`` context. .. cofunction:: get(url) :async-with: :coroutine: A function can be used in ``async with`` and ``await`` context. ``comethod`` also may be used with **staticmethod** and **classmethod** optional specifiers, e.g.:: .. class:: A .. comethod:: f(cls, arg) :classmethod: This is classmethod .. class:: A .. comethod:: f(cls, arg) :classmethod: This is classmethod Usage in `sphinx.ext.autodoc` extension --------------------------------------- .. currentmodule:: autodoc_example ``sphinxcontrib-asyncio`` add special documenters for autodocs, which will use *cofunction* and *comethod* directives if the function is an ``async def`` or is marked with ``coroutine`` decorator. For example this source: .. literalinclude:: autodoc_example.py :language: python Using this simple configuration in your `.rst` file:: .. autocofunction:: coro .. autoclass:: MyClass :members: Will yield next documentation: .. autocofunction:: coro .. autoclass:: MyClass :members: You can set directive options by adding it to `autocofunction` and `autocomethod` directives:: .. autocofunction:: coro :async-for: :coroutine: .. autocofunction:: coro :async-for: :coroutine: You can also force `coroutine` prefix on not-coroutine method by overriding it as `autocomethod` directive:: .. autoclass:: MyClass :members: :exclude-members: my_func .. autocomethod:: my_func() .. autoclass:: MyClass :members: :exclude-members: my_func .. autocomethod:: my_func() Discussion list --------------- *aio-libs* google group: https://groups.google.com/forum/#!forum/aio-libs Please post your questions and ideas here. Authors and License ------------------- The ``sphinxcontrib-asyncio`` package is written by Andrew Svetlov. It's *Apache 2* licensed and freely available. Feel free to improve this package and send a pull request to GitHub_. .. toctree:: :maxdepth: 2 sphinxcontrib-asyncio-0.2.0/docs/make.bat0000664000175000017500000001615712704132373021263 0ustar travistravis00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ 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. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled echo. coverage to run coverage check of the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) REM Check if sphinx-build is available and fallback to Python version if any %SPHINXBUILD% 1>NUL 2>NUL if errorlevel 9009 goto sphinx_python goto sphinx_ok :sphinx_python set SPHINXBUILD=python -m sphinx.__init__ %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) :sphinx_ok if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\sphinxcontrib-asyncio.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\sphinxcontrib-asyncio.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %~dp0 echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %~dp0 echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "coverage" ( %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage if errorlevel 1 exit /b 1 echo. echo.Testing of coverage in the sources finished, look at the ^ results in %BUILDDIR%/coverage/python.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end sphinxcontrib-asyncio-0.2.0/sphinxcontrib/0000775000175000017500000000000012704132422021601 5ustar travistravis00000000000000sphinxcontrib-asyncio-0.2.0/sphinxcontrib/__init__.py0000664000175000017500000000007012704132373023714 0ustar travistravis00000000000000__import__('pkg_resources').declare_namespace(__name__) sphinxcontrib-asyncio-0.2.0/sphinxcontrib/asyncio.py0000664000175000017500000001240112704132373023623 0ustar travistravis00000000000000from docutils.parsers.rst import directives from sphinx.domains.python import PyModulelevel, PyClassmember from sphinx.ext.autodoc import FunctionDocumenter, MethodDocumenter, \ bool_option try: from asyncio import iscoroutinefunction except ImportError: def iscoroutinefunction(func): """Return True if func is a decorated coroutine function.""" return getattr(func, '_is_coroutine', False) __version__ = '0.2.0' def merge_dicts(*dcts): ret = {} for d in dcts: for k, v in d.items(): ret[k] = v return ret class PyCoroutineMixin(object): option_spec = {'coroutine': directives.flag, 'async-with': directives.flag, 'async-for': directives.flag} def get_signature_prefix(self, sig): ret = '' if 'staticmethod' in self.options: ret += 'staticmethod ' if 'classmethod' in self.options: ret += 'classmethod ' if 'coroutine' in self.options: coroutine = True else: coroutine = ('async-with' not in self.options and 'async-for' not in self.options) if coroutine: ret += 'coroutine ' if 'async-with' in self.options: ret += 'async-with ' if 'async-for' in self.options: ret += 'async-for ' return ret class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel): option_spec = merge_dicts(PyCoroutineMixin.option_spec, PyModulelevel.option_spec) def run(self): self.name = 'py:function' return super(PyCoroutineFunction, self).run() class PyCoroutineMethod(PyCoroutineMixin, PyClassmember): option_spec = merge_dicts(PyCoroutineMixin.option_spec, PyClassmember.option_spec, {'staticmethod': directives.flag, 'classmethod': directives.flag}) def run(self): self.name = 'py:method' return super(PyCoroutineMethod, self).run() class CoFunctionDocumenter(FunctionDocumenter): """ Specialized Documenter subclass for functions and coroutines. """ objtype = "cofunction" directivetype = "cofunction" priority = 2 option_spec = merge_dicts( MethodDocumenter.option_spec, {'async-with': bool_option, 'async-for': bool_option, 'coroutine': bool_option }) @classmethod def can_document_member(cls, member, membername, isattr, parent): """Called to see if a member can be documented by this documenter.""" if not super().can_document_member(member, membername, isattr, parent): return False return iscoroutinefunction(member) def add_directive_header(self, sig): super().add_directive_header(sig) sourcename = self.get_sourcename() if self.options.async_with: self.add_line(' :async-with:', sourcename) if self.options.async_for: self.add_line(' :async-for:', sourcename) if self.options.coroutine: self.add_line(' :coroutine:', sourcename) class CoMethodDocumenter(MethodDocumenter): """ Specialized Documenter subclass for methods and coroutines. """ objtype = "comethod" priority = 3 # Higher than CoFunctionDocumenter option_spec = merge_dicts( MethodDocumenter.option_spec, {'staticmethod': bool_option, 'classmethod': bool_option, 'async-with': bool_option, 'async-for': bool_option, 'coroutine': bool_option }) @classmethod def can_document_member(cls, member, membername, isattr, parent): """Called to see if a member can be documented by this documenter.""" if not super().can_document_member(member, membername, isattr, parent): return False return iscoroutinefunction(member) def import_object(self): ret = super().import_object() # Was overridden by method documenter, return to default self.directivetype = "comethod" return ret def add_directive_header(self, sig): super().add_directive_header(sig) sourcename = self.get_sourcename() if self.options.staticmethod: self.add_line(' :staticmethod:', sourcename) if self.options.staticmethod: self.add_line(' :classmethod:', sourcename) if self.options.async_with: self.add_line(' :async-with:', sourcename) if self.options.async_for: self.add_line(' :async-for:', sourcename) if self.options.coroutine: self.add_line(' :coroutine:', sourcename) def setup(app): app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction) app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod) app.add_directive_to_domain('py', 'corofunction', PyCoroutineFunction) app.add_directive_to_domain('py', 'coromethod', PyCoroutineMethod) app.add_directive_to_domain('py', 'cofunction', PyCoroutineFunction) app.add_directive_to_domain('py', 'comethod', PyCoroutineMethod) app.add_autodocumenter(CoFunctionDocumenter) app.add_autodocumenter(CoMethodDocumenter) return {'version': '1.0', 'parallel_read_safe': True} sphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/0000775000175000017500000000000012704132422025020 5ustar travistravis00000000000000sphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/PKG-INFO0000664000175000017500000000234712704132422026123 0ustar travistravis00000000000000Metadata-Version: 1.1 Name: sphinxcontrib-asyncio Version: 0.2.0 Summary: sphinx extension to support coroutines in markup Home-page: https://github.com/aio-libs/sphinxcontrib-asyncio Author: Andrew Svetlov Author-email: andrew.svetlov@gmail.com License: Apache 2 Description: sphinxcontrib-asyncio ===================== Sphinx extension for adding asyncio-specific markups CHANGES ======= 0.2.0 (2016-04-15) ------------------ * Added autodoc support #1 0.1.0 (2016-03-07) ------------------- * Initial release Platform: UNKNOWN Classifier: Environment :: Plugins Classifier: Framework :: Sphinx :: Extension Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Documentation :: Sphinx Classifier: Topic :: Software Development :: Documentation sphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/SOURCES.txt0000664000175000017500000000064112704132422026705 0ustar travistravis00000000000000CHANGES.rst MANIFEST.in Makefile README.rst setup.cfg setup.py docs/Makefile docs/autodoc_example.py docs/conf.py docs/index.rst docs/make.bat sphinxcontrib/__init__.py sphinxcontrib/asyncio.py sphinxcontrib_asyncio.egg-info/PKG-INFO sphinxcontrib_asyncio.egg-info/SOURCES.txt sphinxcontrib_asyncio.egg-info/dependency_links.txt sphinxcontrib_asyncio.egg-info/requires.txt sphinxcontrib_asyncio.egg-info/top_level.txtsphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/dependency_links.txt0000664000175000017500000000000112704132422031066 0ustar travistravis00000000000000 sphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/requires.txt0000664000175000017500000000000712704132422027415 0ustar travistravis00000000000000sphinx sphinxcontrib-asyncio-0.2.0/sphinxcontrib_asyncio.egg-info/top_level.txt0000664000175000017500000000001612704132422027547 0ustar travistravis00000000000000sphinxcontrib sphinxcontrib-asyncio-0.2.0/CHANGES.rst0000664000175000017500000000021712704132373020516 0ustar travistravis00000000000000CHANGES ======= 0.2.0 (2016-04-15) ------------------ * Added autodoc support #1 0.1.0 (2016-03-07) ------------------- * Initial release sphinxcontrib-asyncio-0.2.0/MANIFEST.in0000664000175000017500000000022212704132373020446 0ustar travistravis00000000000000include LICENSE.txt include CHANGES.rst include README.rst include Makefile graft sphinxcontrib graft docs global-exclude *.pyc prune docs/_build sphinxcontrib-asyncio-0.2.0/Makefile0000664000175000017500000000013412704132373020352 0ustar travistravis00000000000000.PHONY: doc doc: make -C docs html @echo "open file://`pwd`/docs/_build/html/index.html" sphinxcontrib-asyncio-0.2.0/README.rst0000664000175000017500000000014212704132373020400 0ustar travistravis00000000000000sphinxcontrib-asyncio ===================== Sphinx extension for adding asyncio-specific markups sphinxcontrib-asyncio-0.2.0/setup.py0000664000175000017500000000367212704132373020436 0ustar travistravis00000000000000import codecs import os import re from setuptools import setup from setuptools.command.test import test as TestCommand with codecs.open(os.path.join(os.path.abspath(os.path.dirname( __file__)), 'sphinxcontrib', 'asyncio.py'), 'r', 'latin1') as fp: try: version = re.findall(r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0] except IndexError: raise RuntimeError('Unable to determine version.') install_requires = ['sphinx'] def read(f): return open(os.path.join(os.path.dirname(__file__), f)).read().strip() class PyTest(TestCommand): user_options = [] def run(self): import subprocess import sys errno = subprocess.call([sys.executable, '-m', 'pytest', 'tests']) raise SystemExit(errno) tests_require = install_requires + ['pytest'] setup( name='sphinxcontrib-asyncio', version=version, description=('sphinx extension to support coroutines in markup'), long_description='\n\n'.join((read('README.rst'), read('CHANGES.rst'))), classifiers=[ 'Environment :: Plugins', 'Framework :: Sphinx :: Extension', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Documentation :: Sphinx', 'Topic :: Software Development :: Documentation'], author='Andrew Svetlov', author_email='andrew.svetlov@gmail.com', url='https://github.com/aio-libs/sphinxcontrib-asyncio', license='Apache 2', packages=['sphinxcontrib'], install_requires=install_requires, tests_require=tests_require, include_package_data=True, cmdclass=dict(test=PyTest)) sphinxcontrib-asyncio-0.2.0/PKG-INFO0000664000175000017500000000234712704132422020012 0ustar travistravis00000000000000Metadata-Version: 1.1 Name: sphinxcontrib-asyncio Version: 0.2.0 Summary: sphinx extension to support coroutines in markup Home-page: https://github.com/aio-libs/sphinxcontrib-asyncio Author: Andrew Svetlov Author-email: andrew.svetlov@gmail.com License: Apache 2 Description: sphinxcontrib-asyncio ===================== Sphinx extension for adding asyncio-specific markups CHANGES ======= 0.2.0 (2016-04-15) ------------------ * Added autodoc support #1 0.1.0 (2016-03-07) ------------------- * Initial release Platform: UNKNOWN Classifier: Environment :: Plugins Classifier: Framework :: Sphinx :: Extension Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Documentation :: Sphinx Classifier: Topic :: Software Development :: Documentation sphinxcontrib-asyncio-0.2.0/setup.cfg0000664000175000017500000000013012704132422020522 0ustar travistravis00000000000000[bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0