wait-for-1.2.0
توضیحات
A waiting based utility with decorator and logger support
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | wait-for-1.2.0 |
| نام | wait-for |
| نسخه کتابخانه | 1.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Peter Savage |
| ایمیل نویسنده | psavage@redhat.com |
| آدرس صفحه اصلی | https://github.com/RedHatQE/wait_for |
| آدرس اینترنتی | https://pypi.org/project/wait-for/ |
| مجوز | Apache |
wait-for
========
Introduction
------------
Waits for a certain amount of time for an action to complete
Designed to wait for a certain length of time,
either linearly in 1 second steps, or exponentially, up to a maximum.
Returns the output from the function once it completes successfully,
along with the time taken to complete the command.
.. note::
If using the expo keyword, the returned elapsed time will be inaccurate
as wait_for does not know the exact time that the function returned
correctly, only that it returned correctly at last check.
Usage
-----
.. code-block:: python
from wait_for import wait_for
class Incrementor():
value = 0
def i_sleep_a_lot(self):
time.sleep(.1)
self.value += 1
return self.value
incman = Incrementor()
ec, tc = wait_for(incman.i_sleep_a_lot,
fail_condition=0,
delay=.05)
print("Function output {} in time {} ".format(ec, tc))
نیازمندی
| مقدار | نام |
|---|---|
| >=2.5 | parsedatetime |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl wait-for-1.2.0:
pip install wait-for-1.2.0.whl
نصب پکیج tar.gz wait-for-1.2.0:
pip install wait-for-1.2.0.tar.gz