From: Michael Orlitzky Date: Fri, 13 Nov 2009 00:59:08 +0000 (-0500) Subject: Added the VerbatimHelpFormatter class to the CLI module. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=commitdiff_plain;h=7910222e257368cd534f5334085f008c36e288c6 Added the VerbatimHelpFormatter class to the CLI module. --- diff --git a/src/CLI.py b/src/CLI.py index b7fcaaf..4da436e 100644 --- a/src/CLI.py +++ b/src/CLI.py @@ -1,3 +1,4 @@ +from optparse import IndentedHelpFormatter from optparse import OptionParser import Configuration.Defaults @@ -23,3 +24,15 @@ def default_option_parser(usage=None): default=Configuration.Defaults.DATABASE_USERNAME) return parser + + + +class VerbatimHelpFormatter(IndentedHelpFormatter): + """ + The two HelpFormatters supplied with OptParse like to mangle their + descriptions during print_help(). This subclassed formatter + overrides the format_description() method with an implementation + that simply returns the description unmodified. + """ + def format_description(self, description): + return description