Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/decorator-4.4.2.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 Metadata-Version: 2.1 | |
2 Name: decorator | |
3 Version: 4.4.2 | |
4 Summary: Decorators for Humans | |
5 Home-page: https://github.com/micheles/decorator | |
6 Author: Michele Simionato | |
7 Author-email: michele.simionato@gmail.com | |
8 License: new BSD License | |
9 Keywords: decorators generic utility | |
10 Platform: All | |
11 Classifier: Development Status :: 5 - Production/Stable | |
12 Classifier: Intended Audience :: Developers | |
13 Classifier: License :: OSI Approved :: BSD License | |
14 Classifier: Natural Language :: English | |
15 Classifier: Operating System :: OS Independent | |
16 Classifier: Programming Language :: Python | |
17 Classifier: Programming Language :: Python :: 2 | |
18 Classifier: Programming Language :: Python :: 2.6 | |
19 Classifier: Programming Language :: Python :: 2.7 | |
20 Classifier: Programming Language :: Python :: 3 | |
21 Classifier: Programming Language :: Python :: 3.2 | |
22 Classifier: Programming Language :: Python :: 3.3 | |
23 Classifier: Programming Language :: Python :: 3.4 | |
24 Classifier: Programming Language :: Python :: 3.5 | |
25 Classifier: Programming Language :: Python :: 3.6 | |
26 Classifier: Programming Language :: Python :: 3.7 | |
27 Classifier: Programming Language :: Python :: Implementation :: CPython | |
28 Classifier: Topic :: Software Development :: Libraries | |
29 Classifier: Topic :: Utilities | |
30 Requires-Python: >=2.6, !=3.0.*, !=3.1.* | |
31 | |
32 Decorators for Humans | |
33 ===================== | |
34 | |
35 The goal of the decorator module is to make it easy to define | |
36 signature-preserving function decorators and decorator factories. | |
37 It also includes an implementation of multiple dispatch and other niceties | |
38 (please check the docs). It is released under a two-clauses | |
39 BSD license, i.e. basically you can do whatever you want with it but I am not | |
40 responsible. | |
41 | |
42 Installation | |
43 ------------- | |
44 | |
45 If you are lazy, just perform | |
46 | |
47 ``$ pip install decorator`` | |
48 | |
49 which will install just the module on your system. | |
50 | |
51 If you prefer to install the full distribution from source, including | |
52 the documentation, clone the `GitHub repo`_ or download the tarball_, unpack it and run | |
53 | |
54 ``$ pip install .`` | |
55 | |
56 in the main directory, possibly as superuser. | |
57 | |
58 .. _tarball: https://pypi.org/project/decorator/#files | |
59 .. _GitHub repo: https://github.com/micheles/decorator | |
60 | |
61 Testing | |
62 -------- | |
63 | |
64 If you have the source code installation you can run the tests with | |
65 | |
66 `$ python src/tests/test.py -v` | |
67 | |
68 or (if you have setuptools installed) | |
69 | |
70 `$ python setup.py test` | |
71 | |
72 Notice that you may run into trouble if in your system there | |
73 is an older version of the decorator module; in such a case remove the | |
74 old version. It is safe even to copy the module `decorator.py` over | |
75 an existing one, since we kept backward-compatibility for a long time. | |
76 | |
77 Repository | |
78 --------------- | |
79 | |
80 The project is hosted on GitHub. You can look at the source here: | |
81 | |
82 https://github.com/micheles/decorator | |
83 | |
84 Documentation | |
85 --------------- | |
86 | |
87 The documentation has been moved to https://github.com/micheles/decorator/blob/master/docs/documentation.md | |
88 | |
89 From there you can get a PDF version by simply using the print | |
90 functionality of your browser. | |
91 | |
92 Here is the documentation for previous versions of the module: | |
93 | |
94 https://github.com/micheles/decorator/blob/4.3.2/docs/tests.documentation.rst | |
95 https://github.com/micheles/decorator/blob/4.2.1/docs/tests.documentation.rst | |
96 https://github.com/micheles/decorator/blob/4.1.2/docs/tests.documentation.rst | |
97 https://github.com/micheles/decorator/blob/4.0.0/documentation.rst | |
98 https://github.com/micheles/decorator/blob/3.4.2/documentation.rst | |
99 | |
100 For the impatient | |
101 ----------------- | |
102 | |
103 Here is an example of how to define a family of decorators tracing slow | |
104 operations: | |
105 | |
106 .. code-block:: python | |
107 | |
108 from decorator import decorator | |
109 | |
110 @decorator | |
111 def warn_slow(func, timelimit=60, *args, **kw): | |
112 t0 = time.time() | |
113 result = func(*args, **kw) | |
114 dt = time.time() - t0 | |
115 if dt > timelimit: | |
116 logging.warn('%s took %d seconds', func.__name__, dt) | |
117 else: | |
118 logging.info('%s took %d seconds', func.__name__, dt) | |
119 return result | |
120 | |
121 @warn_slow # warn if it takes more than 1 minute | |
122 def preprocess_input_files(inputdir, tempdir): | |
123 ... | |
124 | |
125 @warn_slow(timelimit=600) # warn if it takes more than 10 minutes | |
126 def run_calculation(tempdir, outdir): | |
127 ... | |
128 | |
129 Enjoy! | |
130 | |
131 |