A task flow in Python with do and undo
Project description
pyundo
A task flow in Python with do and undo.
Example
from __future__ import print_function from pyundo import TaskBase, LineFlow class Task(TaskBase): def __init__(name): self.name = name def do(self): print("Do the task: {0}".format(self.name)) def undo(self): print("Undo the task: {0}".format(self.name)) def main(): flow = LineFlow() flow.add(Task("task1")) flow.add(Task("task2")) flow.add(Task("task3")) flow.execute() if __name__ == "__main__": main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyundo-0.1.tar.gz
(6.7 kB
view details)
File details
Details for the file pyundo-0.1.tar.gz
.
File metadata
- Download URL: pyundo-0.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72e8627bbf177aad53b069744d61a3632b0db5ecda710b3d2fb3ecc5ed69c2f6 |
|
MD5 | 60945b6af42cdba3a5128d95f6fb8f3d |
|
BLAKE2b-256 | 93250272a2865de0f99737937d9ef74d6441a90f2f8113694394fcaa1c20b6bf |