Part of bzrlib.cleanup View In Hierarchy
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 |