Revision 5a673575 kamaki/cli/commands/__init__.py

b/kamaki/cli/commands/__init__.py
49 49
        except KeyError:
50 50
            pass
51 51

  
52
    def _safe_progress_bar(self, msg, arg='progress_bar'):
53
        """Try to get a progress bar, but do not raise errors"""
54
        try:
55
            progress_bar = self.arguments[arg]
56
            gen = progress_bar.get_generator(msg)
57
        except Exception:
58
            return (None, None)
59
        return (progress_bar, gen)
60

  
61
    def _safe_progress_bar_finish(self, progress_bar):
62
        try:
63
            progress_bar.finish()
64
        except Exception:
65
            pass
66

  
52 67
    def __getitem__(self, argterm):
53 68
        """
54 69
        :param argterm: (str) the name/label of an argument in self.arguments

Also available in: Unified diff