The `Status` class represents the status of some event.
Project description
statuses
The Status
class represents the status of some event. It is one of
either:
Failed
NotStarted
InProgress(progress)
Succeeded
Installation
$ pip install statuses
Example
from typing import Iterable
from status import InProgress, Failed, NotStarted, Succeeded
class Report:
def __init__(self: "Report"):
self.status = NotStarted()
def run(self: "Report", foo: str, bar: Iterable[int]):
if foo == "badstring":
self.status = Failed()
for i, b in enumerate(bar):
self.status = InProgress(i / len(bar) * 100)
print(self.status)
self.status = Succeeded()
r = Report()
print(r.status)
r.run("goodstring", range(10))
print(r.status)
Documentation
Ugly looking documentation can be located at docs/index.html.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
statuses-0.5.0.tar.gz
(7.2 kB
view details)
File details
Details for the file statuses-0.5.0.tar.gz
.
File metadata
- Download URL: statuses-0.5.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9684510b7ec59db157516bf60dd1284eaafeafb27837c1b1c42d0b8b4b7a26d |
|
MD5 | b4424047899fcac74182e61327594abc |
|
BLAKE2b-256 | cd71a33b26b0f6c7459e5ccf539c995242554fd68fa4ddbb7783e13890fabc89 |