1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-decorator
7 SDESC[py37]= Decorators for Humans (PY37)
8 SDESC[py38]= Decorators for Humans (PY38)
9 HOMEPAGE= https://github.com/micheles/decorator
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPI/d/decorator
14 DISTFILE[1]= decorator-4.4.2.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= decorator-4.4.2
28 [PY37].USES_ON= python:py37
30 [PY38].USES_ON= python:py38
32 [FILE:2905:descriptions/desc.single]
36 The goal of the decorator module is to make it easy to define
37 signature-preserving function decorators and decorator factories.
38 It also includes an implementation of multiple dispatch and other niceties
39 (please check the docs). It is released under a two-clauses
40 BSD license, i.e. basically you can do whatever you want with it but I am
47 If you are lazy, just perform
49 ``$ pip install decorator``
51 which will install just the module on your system.
53 If you prefer to install the full distribution from source, including
54 the documentation, clone the `GitHub repo`_ or download the tarball_,
59 in the main directory, possibly as superuser.
61 .. _tarball: https://pypi.org/project/decorator/#files
62 .. _GitHub repo: https://github.com/micheles/decorator
67 If you have the source code installation you can run the tests with
69 `$ python src/tests/test.py -v`
71 or (if you have setuptools installed)
73 `$ python setup.py test`
75 Notice that you may run into trouble if in your system there
76 is an older version of the decorator module; in such a case remove the
77 old version. It is safe even to copy the module `decorator.py` over
78 an existing one, since we kept backward-compatibility for a long time.
83 The project is hosted on GitHub. You can look at the source here:
85 https://github.com/micheles/decorator
90 The documentation has been moved to
91 https://github.com/micheles/decorator/blob/master/docs/documentation.md
93 From there you can get a PDF version by simply using the print
94 functionality of your browser.
96 Here is the documentation for previous versions of the module:
98 https://github.com/micheles/decorator/blob/4.3.2/docs/tests.documentation.rst
99 https://github.com/micheles/decorator/blob/4.2.1/docs/tests.documentation.rst
100 https://github.com/micheles/decorator/blob/4.1.2/docs/tests.documentation.rst
101 https://github.com/micheles/decorator/blob/4.0.0/documentation.rst
102 https://github.com/micheles/decorator/blob/3.4.2/documentation.rst
107 Here is an example of how to define a family of decorators tracing slow
110 .. code-block:: python
112 from decorator import decorator
115 def warn_slow(func, timelimit=60, *args, **kw):
117 result = func(*args, **kw)
118 dt = time.time() - t0
120 logging.warn('%s took %d seconds', func.__name__, dt)
122 logging.info('%s took %d seconds', func.__name__, dt)
125 @warn_slow # warn if it takes more than 1 minute
126 def preprocess_input_files(inputdir, tempdir):
129 @warn_slow(timelimit=600) # warn if it takes more than 10 minutes
130 def run_calculation(tempdir, outdir):
136 e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7 33629 decorator-4.4.2.tar.gz