def usage(self): """ Format this command's usage string """ tpl = Template("Usage: ${cmd_name} ${options}${cmd_args}") return tpl.safe_substitute(cmd_name=self.name, options=self.options and "[options] " or "", cmd_args=self.format_cmd_args())
def usage(self): """ Format this command's usage string """ tpl = Template("Usage: ${cmd_name} ${options}${cmd_args}") return tpl.safe_substitute(cmd_name=self.name, options=self.options and "[options] " or "", cmd_args=self.format_cmd_args())
def info(self): from holland.core.util.template import Template from textwrap import dedent, wrap tmpl = Template(""" backup-plugin = ${plugin} backup-started = ${start-time} backup-finished = ${stop-time} estimated size = ${estimated-size} on-disk size = ${on-disk-size} """) str = tmpl.safe_substitute(self._formatted_config()) str = "\t" + dedent(str).lstrip() str = "\n\t\t".join(str.splitlines()) return str
def info(self): from holland.core.util.template import Template from textwrap import dedent, wrap tmpl = Template(""" backup-plugin = ${plugin} backup-started = ${start-time} backup-finished = ${stop-time} estimated size = ${estimated-size} on-disk size = ${on-disk-size} """) str = tmpl.safe_substitute(self._formatted_config()) str = "\t" + dedent(str).lstrip() str = "\n\t\t".join(str.splitlines()) return str