def console(self):
<EOL>parser = argparse.ArgumentParser(description=self.description)<EOL>self.setup_args(parser)<EOL>args = parser.parse_args()<EOL>for proc in self._preprocess:<EOL><INDENT>try:<EOL><INDENT>proc(args)<EOL><DEDENT>except Exception as exc:<EOL><INDENT>if getattr(args, '<STR_LIT>', False):<EOL><INDENT>raise<EOL><DEDENT>return str(exc)<EOL><DEDENT><DEDENT>result = self.safe_call(self.get_kwargs(args), args)<EOL>for proc in self._postprocess:<EOL><INDENT>result = proc(args, result)<EOL><DEDENT>return result<EOL>
Call the function as a console script.  Command line arguments
are parsed, preprocessors are called, then the function is
called.  If a 'debug' attribute is set by the command line
arguments, and it is True, any exception raised by the
underlying function will be reraised; otherwise, the return
value will be either the return value of the function or the
text contents of the exception.