hiatus
Hiatus is a python library that uses the threading module’s “Timer” to implement analogues to javascript’s setTimeout/clearTimeout and setInterval/clearInterval.
These functions may be used as decorators. Also important is that the python analogues take time arguments in seconds, not milliseconds, in order to be consistent with the standard library.
A Caveat:
Much of python does not “play nice” with threading. You have been warned.
(I looked into a signal-based approach, but this is limited. Another approach would be to depend on an event loop, such as twisted.reactor.)
Examples:
>>> from hiatus import set_interval >>> @set_interval(1.00) ... def dave_grohl(): ... print "THE BEST" ... >>> THE BEST THE BEST THE BEST THE BEST THE BEST
>>> def note(): ... print "HUGE SUCCESS"... >>> hiatus.set_timeout(lambda: hiatus.clear_interval(glados), 6.0) <hiatus.set_timeout object at 0xb770468c> >>> glados = hiatus.set_interval(note, 1.000) >>> HUGE SUCCESS HUGE SUCCESS HUGE SUCCESS HUGE SUCCESS
For more:
Visit <https://github.com/jesusabdullah/hiatus> .
Metadata
Release files for hiatus 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hiatus-0.0.1.tar.gz | 2.1 kB | Without provenance | Details for hiatus-0.0.1.tar.gz |
Release files / hiatus-0.0.1.tar.gz
| Download URL | hiatus-0.0.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81b5dcbd94d4e9d303a2b399d7e21cc6b4e8a00d32ad0301c085dbaafb3f07d4
|
|
BLAKE2b-256 checksum How to use checksums |
cdd613e51ce0616d139247bd7fd310941c21508d24e055efe58be9aa980c2835
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for hiatus 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.