func_timeout/func_timeout/__init__.py
Tim Savannah 32078a8065 Changeup how the function decorator works.
Rename to "set_func_timeout" - Give it 2 possible arguments.

First is either a floating point timeout, or a function which will be
invoked each call of decorated function and passed same arguments, to
calculate the timeout that should be used.

Second is "allowOverride", default False. If True, adds a kwarg to the
function being decorated, "forceTimeout", which if provided will
override any default timeout and prevent a calculation attempt.
2017-05-20 01:52:01 -04:00

16 lines
517 B
Python

'''
Copyright (c) 2016, 2017 Tim Savannah All Rights Reserved.
Licensed under the Lesser GNU Public License Version 3, LGPLv3. You should have recieved a copy of this with the source distribution as
LICENSE, otherwise it is available at https://github.com/kata198/func_timeout/LICENSE
'''
__version__ = '4.0.0'
__version_tuple__ = (4, 0, 0)
__all__ = ('func_timeout', 'func_set_timeout', 'FunctionTimedOut')
from .exceptions import FunctionTimedOut
from .dafunc import func_timeout, func_set_timeout