Skip to main content

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

This version

0.1

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)

Uploaded Source

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

Hashes for pyundo-0.1.tar.gz
Algorithm Hash digest
SHA256 72e8627bbf177aad53b069744d61a3632b0db5ecda710b3d2fb3ecc5ed69c2f6
MD5 60945b6af42cdba3a5128d95f6fb8f3d
BLAKE2b-256 93250272a2865de0f99737937d9ef74d6441a90f2f8113694394fcaa1c20b6bf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page