├── tests ├── __init__.py └── test_timeout.py ├── src └── timeoutcontext │ ├── py.typed │ ├── __init__.py │ └── _timeout.py ├── docs ├── authors.rst ├── history.rst ├── readme.rst ├── contributing.rst ├── installation.rst ├── index.rst ├── Makefile ├── make.bat └── conf.py ├── AUTHORS.rst ├── MANIFEST.in ├── .gitignore ├── HISTORY.rst ├── .github └── workflows │ └── test.yml ├── README.rst ├── pyproject.toml ├── LICENSE ├── CONTRIBUTING.rst └── justfile /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/timeoutcontext/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/authors.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../AUTHORS.rst 2 | -------------------------------------------------------------------------------- /docs/history.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../HISTORY.rst 2 | -------------------------------------------------------------------------------- /docs/readme.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | -------------------------------------------------------------------------------- /docs/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /AUTHORS.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Credits 3 | ======= 4 | 5 | Development Lead 6 | ---------------- 7 | 8 | * Antoine Cezar 9 | 10 | Contributors 11 | ------------ 12 | 13 | * Bryce Guinta 14 | -------------------------------------------------------------------------------- /src/timeoutcontext/__init__.py: -------------------------------------------------------------------------------- 1 | import importlib.metadata 2 | 3 | from ._timeout import timeout 4 | 5 | __version__ = importlib.metadata.version("timeoutcontext") 6 | 7 | __all__ = [ 8 | "timeout", 9 | ] 10 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Installation 3 | ============ 4 | 5 | At the command line:: 6 | 7 | $ pip install timeoutcontext 8 | 9 | Or, if in a virtualenv installed:: 10 | 11 | $ python -m venv my_venv 12 | $ ./my_venv/bin/pip install timeoutcontext 13 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS.rst 2 | include CONTRIBUTING.rst 3 | include HISTORY.rst 4 | include LICENSE 5 | include README.rst 6 | 7 | recursive-include tests * 8 | recursive-exclude * __pycache__ 9 | recursive-exclude * *.py[co] 10 | 11 | recursive-include docs *.rst conf.py Makefile make.bat 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python-generated files 2 | __pycache__/ 3 | *.py[oc] 4 | build/ 5 | dist/ 6 | wheels/ 7 | *.egg-info 8 | 9 | # uv generated files 10 | uv.lock 11 | 12 | # Virtual environments 13 | .venv 14 | 15 | # coverage generated files 16 | .coverage 17 | htmlcov/ 18 | 19 | # Sphinx generated files 20 | docs/_build/ 21 | docs/api/ 22 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. timeoutcontext documentation master file, created by 2 | sphinx-quickstart on Tue Jul 9 22:26:36 2013. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Timeoutcontext's documentation! 7 | ========================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | readme 15 | installation 16 | contributing 17 | authors 18 | history 19 | api/modules 20 | 21 | Indices and tables 22 | ================== 23 | 24 | * :ref:`genindex` 25 | * :ref:`modindex` 26 | * :ref:`search` 27 | 28 | -------------------------------------------------------------------------------- /HISTORY.rst: -------------------------------------------------------------------------------- 1 | .. :changelog: 2 | 3 | History 4 | ------- 5 | 6 | 2.0.0 (2025-11-14) 7 | ------------------ 8 | 9 | * Require python >= 3.9 10 | * Use uv instead of setuptools 11 | * Use pytest as test launcher 12 | * use ruff instead of flake8 13 | * Use just instead of make 14 | * Drop tox 15 | * Add typing 16 | * Fix `link "ImportError: No module named contextdecorator" ` 17 | * Fix `link "ModuleNotFoundError: No module named 'pkg_resources'" ` 18 | * Use github action instead of travis 19 | 20 | 1.2.0 (2018-03-11) 21 | ------------------ 22 | 23 | * Allow sub-second timeout 24 | 25 | 1.1.1 (2016-09-05) 26 | ------------------ 27 | 28 | * Fix README code exemples 29 | 30 | 1.1.0 (2016-09-05) 31 | ------------------ 32 | 33 | * Add the "Not working on Windows operating system" notice 34 | * Rename TimeoutException to TimeoutError 35 | 36 | 1.0.0 (2016-01-23) 37 | ------------------ 38 | 39 | * First release on PyPI. 40 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: check 2 | on: [push] 3 | jobs: 4 | install: 5 | name: python 6 | runs-on: ubuntu-latest 7 | strategy: 8 | max-parallel: 3 9 | matrix: 10 | python-version: 11 | - "3.10" 12 | - "3.11" 13 | - "3.13" 14 | env: 15 | UV_PYTHON: ${{ matrix.python-version }} 16 | steps: 17 | - uses: actions/checkout@v5 18 | 19 | - name: Install just 20 | uses: extractions/setup-just@v3 21 | 22 | - name: Install uv 23 | uses: astral-sh/setup-uv@v6 24 | 25 | - name: Install the project 26 | run: just install 27 | 28 | - name: Check python formating 29 | run: just check-python-formating 30 | 31 | - name: Check python typing 32 | run: just check-python-typing 33 | 34 | - name: Check python docstrings 35 | run: just check-python-docstrings 36 | 37 | - name: Check toml formating 38 | run: just check-toml-formating 39 | 40 | - name: Run tests 41 | run: just test 42 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Timeoutcontext 3 | ============== 4 | 5 | .. image:: https://img.shields.io/pypi/v/timeoutcontext.svg 6 | :target: https://pypi.python.org/pypi/timeoutcontext 7 | 8 | 9 | A `signal `_ based 10 | timeout context manager and decorator. 11 | 12 | Since it is signal based this package can not work under Windows operating 13 | system. 14 | 15 | Usage 16 | ----- 17 | 18 | As a context manager: 19 | 20 | .. code:: python 21 | 22 | import sys 23 | from time import sleep 24 | rom timeoutcontext import timeout 25 | 26 | try: 27 | with timeout(1): 28 | sleep(2) 29 | except TimeoutError: 30 | print('timeout') 31 | 32 | As a decorator: 33 | 34 | .. code:: python 35 | 36 | import sys 37 | from time import sleep 38 | from timeoutcontext import timeout 39 | 40 | @timeout(1) 41 | def wait(): 42 | sleep(2) 43 | 44 | try: 45 | wait() 46 | except TimeoutError: 47 | print('timeout') 48 | 49 | License 50 | ------- 51 | 52 | * Free software: BSD license 53 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "timeoutcontext" 3 | version = "2.0.0" 4 | description = "A signal based timeout context manager" 5 | readme = "README.rst" 6 | requires-python = ">=3.10" 7 | license = "BSD-2-Clause" 8 | authors = [ 9 | { name = "Antoine Cezar", email = "AntoineCezar@users.noreply.github.com" } 10 | ] 11 | classifiers = [ 12 | "Development Status :: 5 - Production/Stable", 13 | "Intended Audience :: Developers", 14 | "License :: OSI Approved :: BSD License", 15 | "Natural Language :: English", 16 | "Programming Language :: Python :: 3.10", 17 | ] 18 | dependencies = [] 19 | 20 | [project.urls] 21 | Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md" 22 | Documentation = "http://timeoutcontext.readthedocs.org/" 23 | Homepage = "https://github.com/AntoineCezar/timeoutcontext" 24 | Issues = "https://github.com/AntoineCezar/timeoutcontext/issues" 25 | Repository = "http://timeoutcontext.readthedocs.org/" 26 | 27 | [dependency-groups] 28 | dev = [ 29 | "coverage>=7.10.7", 30 | "mypy>=1.18.2", 31 | "pytest>=8.4.2", 32 | "ruff>=0.14.4", 33 | "sphinxcontrib-apidoc>=0.6.0", 34 | "tombi>=0.6.48", 35 | ] 36 | 37 | [build-system] 38 | requires = ["uv_build>=0.9.7,<0.10.0"] 39 | build-backend = "uv_build" 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Antoine Cezar 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /src/timeoutcontext/_timeout.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import signal 4 | from contextlib import ContextDecorator 5 | from types import FrameType, TracebackType 6 | from typing import Any 7 | 8 | 9 | def raise_timeout(signum: int, frame: FrameType | None) -> Any: 10 | raise TimeoutError() 11 | 12 | 13 | class timeout(ContextDecorator): 14 | """Raises TimeoutError when the gien time in seconds elapsed. 15 | 16 | As a context manager: 17 | 18 | >>> import sys 19 | >>> from time import sleep 20 | >>> from timeoutcontext import timeout 21 | >>> 22 | >>> try: 23 | ... with timeout(1): 24 | ... sleep(2) 25 | ... except TimeoutError: 26 | ... print('timeout') 27 | ... 28 | timeout 29 | 30 | As a decorator: 31 | 32 | >>> import sys 33 | >>> from time import sleep 34 | >>> from timeoutcontext import timeout 35 | >>> 36 | >>> @timeout(1) 37 | ... def wait(): 38 | ... sleep(2) 39 | ... 40 | >>> try: 41 | ... wait() 42 | ... except TimeoutError: 43 | ... print('timeout') 44 | ... 45 | timeout 46 | """ 47 | 48 | def __init__(self, seconds: float | None) -> None: 49 | self._seconds = seconds 50 | 51 | def __enter__(self) -> timeout: 52 | if self._seconds: 53 | self._replace_alarm_handler() 54 | signal.setitimer(signal.ITIMER_REAL, self._seconds) 55 | return self 56 | 57 | def __exit__( 58 | self, 59 | exc_type: type[BaseException] | None, 60 | exc_value: BaseException | None, 61 | traceback: TracebackType | None, 62 | ) -> None: 63 | if self._seconds: 64 | self._restore_alarm_handler() 65 | signal.alarm(0) 66 | 67 | def _replace_alarm_handler(self) -> None: 68 | self._old_alarm_handler = signal.signal(signal.SIGALRM, raise_timeout) 69 | 70 | def _restore_alarm_handler(self) -> None: 71 | signal.signal(signal.SIGALRM, self._old_alarm_handler) 72 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Contributing 3 | ============ 4 | 5 | Contributions are welcome, and they are greatly appreciated! Every 6 | little bit helps, and credit will always be given. 7 | 8 | You can contribute in many ways: 9 | 10 | Types of Contributions 11 | ---------------------- 12 | 13 | Report Bugs 14 | ~~~~~~~~~~~ 15 | 16 | Report bugs at https://github.com/AntoineCezar/timeoutcontext/issues. 17 | 18 | If you are reporting a bug, please include: 19 | 20 | * Your operating system name and version. 21 | * Any details about your local setup that might be helpful in troubleshooting. 22 | * Detailed steps to reproduce the bug. 23 | 24 | Fix Bugs 25 | ~~~~~~~~ 26 | 27 | Look through the GitHub issues for bugs. Anything tagged with "bug" 28 | is open to whoever wants to implement it. 29 | 30 | Implement Features 31 | ~~~~~~~~~~~~~~~~~~ 32 | 33 | Look through the GitHub issues for features. Anything tagged with "feature" 34 | is open to whoever wants to implement it. 35 | 36 | Write Documentation 37 | ~~~~~~~~~~~~~~~~~~~ 38 | 39 | Timeoutcontext could always use more documentation, whether as part of the 40 | official Timeoutcontext docs, in docstrings, or even on the web in blog posts, 41 | articles, and such. 42 | 43 | Submit Feedback 44 | ~~~~~~~~~~~~~~~ 45 | 46 | The best way to send feedback is to file an issue at https://github.com/AntoineCezar/timeoutcontext/issues. 47 | 48 | If you are proposing a feature: 49 | 50 | * Explain in detail how it would work. 51 | * Keep the scope as narrow as possible, to make it easier to implement. 52 | * Remember that this is a volunteer-driven project, and that contributions 53 | are welcome :) 54 | 55 | Get Started! 56 | ------------ 57 | 58 | Ready to contribute? Here's how to set up `timeoutcontext` for local development. 59 | 60 | 1. Install `link uv ` 61 | 2. Install `link just ` 62 | 3. Fork the `timeoutcontext` repo on GitHub. 63 | 4. Clone your fork locally 64 | 5. Install the project in a developement virtualenv:: 65 | 66 | $ cd timeoutcontext/ 67 | $ just install 68 | 69 | 6. Make your changes. 70 | 6. Check your changes:: 71 | 72 | $ just check-all 73 | $ just test 74 | 75 | 7. Commit your changes and push your branch to GitHub. 76 | 7. Submit a pull request through the GitHub website. 77 | 78 | Pull Request Guidelines 79 | ----------------------- 80 | 81 | Before you submit a pull request, check that it meets these guidelines: 82 | 83 | 1. The pull request should include tests. 84 | 2. If the pull request adds functionality, the docs should be updated. Put 85 | your new functionality into a function with a docstring, and add the 86 | feature to the list in README.rst. 87 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | # Print help 2 | help: 3 | just --list --unsorted 4 | 5 | # Install / update the project's development virtualenv 6 | install: 7 | uv sync --dev 8 | 9 | [group('lint')] 10 | check-all: check-python-formating check-python-typing check-python-docstrings check-toml-formating 11 | 12 | # Check python formating 13 | [group('lint')] 14 | check-python-formating: 15 | uv run ruff check --select=F401,I001 src tests docs 16 | uv run ruff format --check src tests docs 17 | 18 | # Check python typing 19 | [group('lint')] 20 | check-python-typing: 21 | uv run mypy --strict src 22 | uv run mypy tests 23 | 24 | # Check python docstrings 25 | [group('lint')] 26 | check-python-docstrings: 27 | uv run pytest \ 28 | --ignore="./tests" \ 29 | --doctest-modules \ 30 | 31 | # Check toml formating 32 | [group('lint')] 33 | check-toml-formating: 34 | uv run tombi format --check 35 | 36 | [group('lint')] 37 | fix-all: fix-python-formating fix-toml-formating 38 | 39 | # Fix python formating 40 | [group('lint')] 41 | fix-python-formating: 42 | uv run ruff check --fix --select=F401,I001 src tests docs 43 | uv run ruff format src tests docs 44 | 45 | # Fix toml formating 46 | [group('lint')] 47 | fix-toml-formating: 48 | uv run tombi format 49 | 50 | # Run tests 51 | [group('test')] 52 | test *ARGS: 53 | uv run pytest {{ ARGS }} 54 | 55 | # Run and report code coverage 56 | [group('test')] 57 | coverage: coverage-run coverage-report 58 | 59 | # Run code coverage measurement 60 | [group('test')] 61 | coverage-run *ARGS: clean-coverage 62 | uv run pytest --cov=timeoutcontext {{ ARGS }} 63 | 64 | # Report code coverage 65 | [group('test')] 66 | coverage-report *ARGS="-m": 67 | uv run coverage report {{ ARGS }} 68 | 69 | # Report code coverage in html 70 | [group('test')] 71 | coverage-report-html *ARGS: 72 | just coverage-report html {{ ARGS }} 73 | $(BROWSER) htmlcov/index.html 74 | 75 | # Remove coverage artifacts 76 | [group('test')] 77 | clean-coverage: 78 | rm -f .coverage htmlcov/ 79 | 80 | # Build documentation 81 | [group('build')] 82 | build-docs: clean-docs 83 | mkdir -p docs/_static # Avoids missing dir warning 84 | make -C docs html SPHINXBUILD="uv run sphinx-build" 85 | echo "docs/_build/html/index.html" 86 | 87 | # Remove docs build artifacts 88 | [group('build')] 89 | clean-docs: 90 | make -C docs clean SPHINXBUILD="uv run sphinx-build" 91 | 92 | # Build package 93 | [group('build')] 94 | build-dist: clean-dist 95 | uv build 96 | 97 | # Remove package build artifacts 98 | [group('build')] 99 | clean-dist: 100 | rm -fr dist/ 101 | -------------------------------------------------------------------------------- /tests/test_timeout.py: -------------------------------------------------------------------------------- 1 | import time 2 | import unittest 3 | from contextlib import contextmanager 4 | from unittest.mock import patch 5 | 6 | from timeoutcontext._timeout import ( 7 | raise_timeout, 8 | timeout, 9 | ) 10 | 11 | 12 | class BaseTestCase(unittest.TestCase): 13 | @contextmanager 14 | def assertNotRaises(self, exc_type): 15 | try: 16 | yield None 17 | except exc_type: 18 | raise self.failureException("{} raised".format(exc_type.__name__)) 19 | 20 | 21 | class TestTimeoutAsAContextManager(BaseTestCase): 22 | def test_it_raise_timeout_exception_when_time_is_out(self): 23 | with self.assertRaises(TimeoutError): 24 | with timeout(1): 25 | time.sleep(2) 26 | 27 | def test_it_does_not_raise_timeout_exception_when_time_is_not_out(self): 28 | with self.assertNotRaises(TimeoutError): 29 | with timeout(2): 30 | time.sleep(1) 31 | 32 | def test_it_does_not_timeout_when_given_time_is_none(self): 33 | with self.assertNotRaises(TimeoutError): 34 | with timeout(None): 35 | time.sleep(1) 36 | 37 | @patch("timeoutcontext._timeout.signal") 38 | def test_it_does_not_replace_alarm_handler_when_seconds_is_none(self, signal_mock): 39 | with timeout(None): 40 | signal_mock.signal.assert_not_called() 41 | 42 | @patch("timeoutcontext._timeout.signal") 43 | def test_it_does_not_set_alarm_when_seconds_is_none(self, signal_mock): 44 | with timeout(None): 45 | signal_mock.alarm.assert_not_called() 46 | 47 | @patch("timeoutcontext._timeout.signal") 48 | def test_it_does_not_restore_alarm_handler_when_seconds_is_none(self, signal_mock): 49 | with timeout(None): 50 | pass 51 | 52 | signal_mock.signal.assert_not_called() 53 | 54 | def test_it_does_not_timeout_when_given_time_is_zero(self): 55 | with self.assertNotRaises(TimeoutError): 56 | with timeout(0): 57 | time.sleep(1) 58 | 59 | @patch("timeoutcontext._timeout.signal") 60 | def test_it_does_not_replace_alarm_handler_when_seconds_is_zero(self, signal_mock): 61 | with timeout(0): 62 | signal_mock.signal.assert_not_called() 63 | 64 | @patch("timeoutcontext._timeout.signal") 65 | def test_it_does_not_set_alarm_when_seconds_is_zero(self, signal_mock): 66 | with timeout(0): 67 | signal_mock.setitimer.assert_not_called() 68 | 69 | @patch("timeoutcontext._timeout.signal") 70 | def test_it_does_not_restore_alarm_handler_when_seconds_is_zero(self, signal_mock): 71 | with timeout(0): 72 | pass 73 | 74 | signal_mock.signal.assert_not_called() 75 | 76 | @patch("timeoutcontext._timeout.signal") 77 | def test_it_replace_alarm_handler_on_enter(self, signal_mock): 78 | with timeout(2): 79 | signal_mock.signal.assert_called_with(signal_mock.SIGALRM, raise_timeout) 80 | 81 | @patch("timeoutcontext._timeout.signal") 82 | def test_it_request_alarm_to_be_sent_in_given_seconds_on_enter(self, signal_mock): 83 | with timeout(2): 84 | signal_mock.setitimer.assert_called_with(signal_mock.ITIMER_REAL, 2) 85 | 86 | @patch("timeoutcontext._timeout.signal") 87 | def test_it_restore_alarm_handler_on_exit(self, signal_mock): 88 | old_alarm_handler = signal_mock.signal() 89 | 90 | with timeout(2): 91 | pass 92 | 93 | signal_mock.signal.assert_called_with(signal_mock.SIGALRM, old_alarm_handler) 94 | 95 | @patch("timeoutcontext._timeout.signal") 96 | def test_it_resets_alarm_on_exit(self, signal_mock): 97 | with timeout(2): 98 | pass 99 | 100 | signal_mock.alarm.assert_called_with(0) 101 | 102 | 103 | class TestTimeoutAsADecorator(BaseTestCase): 104 | def test_it_raise_timeout_exception_when_time_is_out(self): 105 | @timeout(1) 106 | def decorated(): 107 | time.sleep(2) 108 | 109 | with self.assertRaises(TimeoutError): 110 | decorated() 111 | 112 | def test_it_does_not_raise_timeout_exception_when_time_is_not_out(self): 113 | @timeout(2) 114 | def decorated(): 115 | time.sleep(1) 116 | 117 | with self.assertNotRaises(TimeoutError): 118 | decorated() 119 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(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/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* api/ 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/timeoutcontext.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/timeoutcontext.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/timeoutcontext" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/timeoutcontext" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | goto end 41 | ) 42 | 43 | if "%1" == "clean" ( 44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 45 | del /q /s %BUILDDIR%\* 46 | goto end 47 | ) 48 | 49 | 50 | %SPHINXBUILD% 2> nul 51 | if errorlevel 9009 ( 52 | echo. 53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 54 | echo.installed, then set the SPHINXBUILD environment variable to point 55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 56 | echo.may add the Sphinx directory to PATH. 57 | echo. 58 | echo.If you don't have Sphinx installed, grab it from 59 | echo.http://sphinx-doc.org/ 60 | exit /b 1 61 | ) 62 | 63 | if "%1" == "html" ( 64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 68 | goto end 69 | ) 70 | 71 | if "%1" == "dirhtml" ( 72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 76 | goto end 77 | ) 78 | 79 | if "%1" == "singlehtml" ( 80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 84 | goto end 85 | ) 86 | 87 | if "%1" == "pickle" ( 88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can process the pickle files. 92 | goto end 93 | ) 94 | 95 | if "%1" == "json" ( 96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 97 | if errorlevel 1 exit /b 1 98 | echo. 99 | echo.Build finished; now you can process the JSON files. 100 | goto end 101 | ) 102 | 103 | if "%1" == "htmlhelp" ( 104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 105 | if errorlevel 1 exit /b 1 106 | echo. 107 | echo.Build finished; now you can run HTML Help Workshop with the ^ 108 | .hhp project file in %BUILDDIR%/htmlhelp. 109 | goto end 110 | ) 111 | 112 | if "%1" == "qthelp" ( 113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 114 | if errorlevel 1 exit /b 1 115 | echo. 116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 117 | .qhcp project file in %BUILDDIR%/qthelp, like this: 118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\timeoutcontext.qhcp 119 | echo.To view the help file: 120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\timeoutcontext.ghc 121 | goto end 122 | ) 123 | 124 | if "%1" == "devhelp" ( 125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished. 129 | goto end 130 | ) 131 | 132 | if "%1" == "epub" ( 133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 137 | goto end 138 | ) 139 | 140 | if "%1" == "latex" ( 141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 145 | goto end 146 | ) 147 | 148 | if "%1" == "latexpdf" ( 149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 150 | cd %BUILDDIR%/latex 151 | make all-pdf 152 | cd %BUILDDIR%/.. 153 | echo. 154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 155 | goto end 156 | ) 157 | 158 | if "%1" == "latexpdfja" ( 159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 160 | cd %BUILDDIR%/latex 161 | make all-pdf-ja 162 | cd %BUILDDIR%/.. 163 | echo. 164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 165 | goto end 166 | ) 167 | 168 | if "%1" == "text" ( 169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 170 | if errorlevel 1 exit /b 1 171 | echo. 172 | echo.Build finished. The text files are in %BUILDDIR%/text. 173 | goto end 174 | ) 175 | 176 | if "%1" == "man" ( 177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 178 | if errorlevel 1 exit /b 1 179 | echo. 180 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 181 | goto end 182 | ) 183 | 184 | if "%1" == "texinfo" ( 185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 186 | if errorlevel 1 exit /b 1 187 | echo. 188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 189 | goto end 190 | ) 191 | 192 | if "%1" == "gettext" ( 193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 194 | if errorlevel 1 exit /b 1 195 | echo. 196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 197 | goto end 198 | ) 199 | 200 | if "%1" == "changes" ( 201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 202 | if errorlevel 1 exit /b 1 203 | echo. 204 | echo.The overview file is in %BUILDDIR%/changes. 205 | goto end 206 | ) 207 | 208 | if "%1" == "linkcheck" ( 209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 210 | if errorlevel 1 exit /b 1 211 | echo. 212 | echo.Link check complete; look for any errors in the above output ^ 213 | or in %BUILDDIR%/linkcheck/output.txt. 214 | goto end 215 | ) 216 | 217 | if "%1" == "doctest" ( 218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 219 | if errorlevel 1 exit /b 1 220 | echo. 221 | echo.Testing of doctests in the sources finished, look at the ^ 222 | results in %BUILDDIR%/doctest/output.txt. 223 | goto end 224 | ) 225 | 226 | if "%1" == "xml" ( 227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 228 | if errorlevel 1 exit /b 1 229 | echo. 230 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 231 | goto end 232 | ) 233 | 234 | if "%1" == "pseudoxml" ( 235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 236 | if errorlevel 1 exit /b 1 237 | echo. 238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 239 | goto end 240 | ) 241 | 242 | :end 243 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # timeoutcontext documentation build configuration file, created by 5 | # sphinx-quickstart on Tue Jul 9 22:26:36 2013. 6 | # 7 | # This file is execfile()d with the current directory set to its 8 | # containing dir. 9 | # 10 | # Note that not all possible configuration values are present in this 11 | # autogenerated file. 12 | # 13 | # All configuration values have a default; values that are commented out 14 | # serve to show the default. 15 | 16 | import os 17 | import sys 18 | 19 | # If extensions (or modules to document with autodoc) are in another 20 | # directory, add these directories to sys.path here. If the directory is 21 | # relative to the documentation root, use os.path.abspath to make it 22 | # absolute, like shown here. 23 | # sys.path.insert(0, os.path.abspath('.')) 24 | 25 | # Get the project root dir, which is the parent dir of this 26 | cwd = os.getcwd() 27 | project_root = os.path.dirname(cwd) 28 | 29 | # Insert the project root dir as the first element in the PYTHONPATH. 30 | # This lets us ensure that the source package is imported, and that its 31 | # version is used. 32 | sys.path.insert(0, project_root) 33 | 34 | import timeoutcontext 35 | 36 | # -- General configuration --------------------------------------------- 37 | 38 | # If your documentation needs a minimal Sphinx version, state it here. 39 | # needs_sphinx = '1.0' 40 | 41 | # Add any Sphinx extension module names here, as strings. They can be 42 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 43 | extensions = [ 44 | "sphinx.ext.autodoc", 45 | "sphinx.ext.viewcode", 46 | "sphinxcontrib.apidoc", 47 | ] 48 | 49 | # Add any paths that contain templates here, relative to this directory. 50 | templates_path = ["_templates"] 51 | 52 | # The suffix of source filenames. 53 | source_suffix = ".rst" 54 | 55 | # The encoding of source files. 56 | # source_encoding = 'utf-8-sig' 57 | 58 | # The master toctree document. 59 | master_doc = "index" 60 | 61 | # General information about the project. 62 | project = "Timeoutcontext" 63 | copyright = "2016, Antoine Cezar" 64 | 65 | # The version info for the project you're documenting, acts as replacement 66 | # for |version| and |release|, also used in various other places throughout 67 | # the built documents. 68 | # 69 | # The short X.Y version. 70 | version = timeoutcontext.__version__ 71 | # The full version, including alpha/beta/rc tags. 72 | release = timeoutcontext.__version__ 73 | 74 | # The language for content autogenerated by Sphinx. Refer to documentation 75 | # for a list of supported languages. 76 | # language = None 77 | 78 | # There are two options for replacing |today|: either, you set today to 79 | # some non-false value, then it is used: 80 | # today = '' 81 | # Else, today_fmt is used as the format for a strftime call. 82 | # today_fmt = '%B %d, %Y' 83 | 84 | # List of patterns, relative to source directory, that match files and 85 | # directories to ignore when looking for source files. 86 | exclude_patterns = ["_build"] 87 | 88 | # The reST default role (used for this markup: `text`) to use for all 89 | # documents. 90 | # default_role = None 91 | 92 | # If true, '()' will be appended to :func: etc. cross-reference text. 93 | # add_function_parentheses = True 94 | 95 | # If true, the current module name will be prepended to all description 96 | # unit titles (such as .. function::). 97 | # add_module_names = True 98 | 99 | # If true, sectionauthor and moduleauthor directives will be shown in the 100 | # output. They are ignored by default. 101 | # show_authors = False 102 | 103 | # The name of the Pygments (syntax highlighting) style to use. 104 | pygments_style = "sphinx" 105 | 106 | # A list of ignored prefixes for module index sorting. 107 | # modindex_common_prefix = [] 108 | 109 | # If true, keep warnings as "system message" paragraphs in the built 110 | # documents. 111 | # keep_warnings = False 112 | 113 | 114 | # -- Options for HTML output ------------------------------------------- 115 | 116 | # The theme to use for HTML and HTML Help pages. See the documentation for 117 | # a list of builtin themes. 118 | html_theme = "default" 119 | 120 | # Theme options are theme-specific and customize the look and feel of a 121 | # theme further. For a list of options available for each theme, see the 122 | # documentation. 123 | # html_theme_options = {} 124 | 125 | # Add any paths that contain custom themes here, relative to this directory. 126 | # html_theme_path = [] 127 | 128 | # The name for this set of Sphinx documents. If None, it defaults to 129 | # " v documentation". 130 | # html_title = None 131 | 132 | # A shorter title for the navigation bar. Default is the same as 133 | # html_title. 134 | # html_short_title = None 135 | 136 | # The name of an image file (relative to this directory) to place at the 137 | # top of the sidebar. 138 | # html_logo = None 139 | 140 | # The name of an image file (within the static path) to use as favicon 141 | # of the docs. This file should be a Windows icon file (.ico) being 142 | # 16x16 or 32x32 pixels large. 143 | # html_favicon = None 144 | 145 | # Add any paths that contain custom static files (such as style sheets) 146 | # here, relative to this directory. They are copied after the builtin 147 | # static files, so a file named "default.css" will overwrite the builtin 148 | # "default.css". 149 | html_static_path = ["_static"] 150 | 151 | # If not '', a 'Last updated on:' timestamp is inserted at every page 152 | # bottom, using the given strftime format. 153 | # html_last_updated_fmt = '%b %d, %Y' 154 | 155 | # If true, SmartyPants will be used to convert quotes and dashes to 156 | # typographically correct entities. 157 | # html_use_smartypants = True 158 | 159 | # Custom sidebar templates, maps document names to template names. 160 | # html_sidebars = {} 161 | 162 | # Additional templates that should be rendered to pages, maps page names 163 | # to template names. 164 | # html_additional_pages = {} 165 | 166 | # If false, no module index is generated. 167 | # html_domain_indices = True 168 | 169 | # If false, no index is generated. 170 | # html_use_index = True 171 | 172 | # If true, the index is split into individual pages for each letter. 173 | # html_split_index = False 174 | 175 | # If true, links to the reST sources are added to the pages. 176 | # html_show_sourcelink = True 177 | 178 | # If true, "Created using Sphinx" is shown in the HTML footer. 179 | # Default is True. 180 | # html_show_sphinx = True 181 | 182 | # If true, "(C) Copyright ..." is shown in the HTML footer. 183 | # Default is True. 184 | # html_show_copyright = True 185 | 186 | # If true, an OpenSearch description file will be output, and all pages 187 | # will contain a tag referring to it. The value of this option 188 | # must be the base URL from which the finished HTML is served. 189 | # html_use_opensearch = '' 190 | 191 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 192 | # html_file_suffix = None 193 | 194 | # Output file base name for HTML help builder. 195 | htmlhelp_basename = "timeoutcontextdoc" 196 | 197 | 198 | # -- Options for LaTeX output ------------------------------------------ 199 | 200 | latex_elements = { 201 | # The paper size ('letterpaper' or 'a4paper'). 202 | #'papersize': 'letterpaper', 203 | # The font size ('10pt', '11pt' or '12pt'). 204 | #'pointsize': '10pt', 205 | # Additional stuff for the LaTeX preamble. 206 | #'preamble': '', 207 | } 208 | 209 | # Grouping the document tree into LaTeX files. List of tuples 210 | # (source start file, target name, title, author, documentclass 211 | # [howto/manual]). 212 | latex_documents = [ 213 | ( 214 | "index", 215 | "timeoutcontext.tex", 216 | "Timeoutcontext Documentation", 217 | "Antoine Cezar", 218 | "manual", 219 | ), 220 | ] 221 | 222 | # The name of an image file (relative to this directory) to place at 223 | # the top of the title page. 224 | # latex_logo = None 225 | 226 | # For "manual" documents, if this is true, then toplevel headings 227 | # are parts, not chapters. 228 | # latex_use_parts = False 229 | 230 | # If true, show page references after internal links. 231 | # latex_show_pagerefs = False 232 | 233 | # If true, show URL addresses after external links. 234 | # latex_show_urls = False 235 | 236 | # Documents to append as an appendix to all manuals. 237 | # latex_appendices = [] 238 | 239 | # If false, no module index is generated. 240 | # latex_domain_indices = True 241 | 242 | 243 | # -- Options for manual page output ------------------------------------ 244 | 245 | # One entry per manual page. List of tuples 246 | # (source start file, name, description, authors, manual section). 247 | man_pages = [ 248 | ("index", "timeoutcontext", "Timeoutcontext Documentation", ["Antoine Cezar"], 1) 249 | ] 250 | 251 | # If true, show URL addresses after external links. 252 | # man_show_urls = False 253 | 254 | 255 | # -- Options for Texinfo output ---------------------------------------- 256 | 257 | # Grouping the document tree into Texinfo files. List of tuples 258 | # (source start file, target name, title, author, 259 | # dir menu entry, description, category) 260 | texinfo_documents = [ 261 | ( 262 | "index", 263 | "timeoutcontext", 264 | "Timeoutcontext Documentation", 265 | "Antoine Cezar", 266 | "timeoutcontext", 267 | "One line description of project.", 268 | "Miscellaneous", 269 | ), 270 | ] 271 | 272 | # Documents to append as an appendix to all manuals. 273 | # texinfo_appendices = [] 274 | 275 | # If false, no module index is generated. 276 | # texinfo_domain_indices = True 277 | 278 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 279 | # texinfo_show_urls = 'footnote' 280 | 281 | # If true, do not generate a @detailmenu in the "Top" node's menu. 282 | # texinfo_no_detailmenu = False 283 | 284 | # -- Options for apidoc output ---------------------------------------- 285 | apidoc_module_dir = "../src/" 286 | # apidoc_output_dir = "api" 287 | # apidoc_excluded_paths = ["tests"] 288 | # apidoc_separate_modules = True 289 | --------------------------------------------------------------------------------