Metadata-Version: 2.0
Name: timeoutcontext
Version: 1.0.0
Summary: A signal based timeout context manager
Home-page: https://github.com/AntoineCezar/timeoutcontext
Author: Antoine Cezar
Author-email: antoine@cezar.fr
License: BSD
Keywords: timeoutcontext
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3

==============
Timeoutcontext
==============

.. image:: https://img.shields.io/travis/AntoineCezar/timeoutcontext.svg
        :target: https://travis-ci.org/AntoineCezar/timeoutcontext

.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
        :target: http://timeoutcontext.readthedocs.org/

.. image:: https://img.shields.io/coveralls/AntoineCezar/timeoutcontext.svg
        :target: https://coveralls.io/github/AntoineCezar/timeoutcontext

.. image:: https://img.shields.io/pypi/v/timeoutcontext.svg
        :target: https://pypi.python.org/pypi/timeoutcontext


A `signal <https://docs.python.org/library/signal.html#>`_ based
timeout context manager and decorator.

Usage
-----

As a context manager:

.. code:: python

    from timeoutcontext import timeout, TimeoutException
    from time import sleep

    try:
        with timeout(1):
            sleep(2)
    except TimeoutException:
        print('timeout')

As a decorator:

.. code:: python

    from timeoutcontext import timeout, TimeoutException
    from time import sleep

    @timeout(1)
    def wait():
        sleep(2)

    try:
        wait()
    except TimeoutException:
        print('timeout')

License
-------

* Free software: BSD license




History
-------

1.0.0 (2016-01-23)
---------------------

* First release on PyPI.


