b.c.OperationWithCleanups(ObjectWithCleanups) : class documentation

Part of bzrlib.cleanup View In Hierarchy

A way to run some code with a dynamic cleanup list.

This provides a way to add cleanups while the function-with-cleanups is running.

Typical use:

operation = OperationWithCleanups(some_func)
operation.run(args...)

where some_func is:

def some_func(operation, args, ...):
    do_something()
    operation.add_cleanup(something)
    # etc

Note that the first argument passed to some_func will be the OperationWithCleanups object. To invoke some_func without that, use run_simple instead of run.

Method __init__ Undocumented
Method run Undocumented
Method run_simple Undocumented

Inherited from ObjectWithCleanups:

Method add_cleanup Add a cleanup to run.
Method cleanup_now Undocumented
def __init__(self, func):
Undocumented
def run(self, *args, **kwargs):
Undocumented
def run_simple(self, *args, **kwargs):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.