~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Andrew Bennetts
  • Date: 2009-12-16 13:10:03 UTC
  • mto: This revision was merged to the branch mainline in revision 4948.
  • Revision ID: andrew.bennetts@canonical.com-20091216131003-7161dih4q94x3irz
Add add_cleanup to Command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
import bzrlib
42
42
from bzrlib import (
 
43
    cleanup,
43
44
    debug,
44
45
    errors,
45
46
    option,
384
385
            warn("No help message set for %r" % self)
385
386
        # List of standard options directly supported
386
387
        self.supported_std_options = []
387
 
 
 
388
        self._operation = cleanup.OperationWithCleanups(self.run)
 
389
    
 
390
    def add_cleanup(self, cleanup_func, *args, **kwargs):
 
391
        self._operation.add_cleanup(cleanup_func, *args, **kwargs)
 
392
        
388
393
    @deprecated_method(deprecated_in((2, 1, 0)))
389
394
    def _maybe_expand_globs(self, file_list):
390
395
        """Glob expand file_list if the platform does not do that itself.
635
640
 
636
641
        self._setup_outf()
637
642
 
638
 
        return self.run(**all_cmd_args)
 
643
        return self._operation.run_simple(**all_cmd_args)
639
644
 
640
645
    def run(self):
641
646
        """Actually run the command.