def report(self, msg, *args, **kargs): """ 'print' shortcut that includes some color and formatting """ label = self._report_name() return util.report(label, msg, *args, **kargs)
def catch_network_error(exc): if isinstance(exc, fabric.exceptions.NetworkError): util.report('NetworkError', 'sleeping and retrying') return True