Mercurial > hg > MakeItSo
comparison makeitso/python_module/{{module}}.py @ 153:a5ea79f3221f
.strip() the description
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sat, 01 Dec 2012 19:15:48 -0800 |
| parents | 88f5bab340a1 |
| children | ebc5cfe17d95 |
comparison
equal
deleted
inserted
replaced
| 152:88f5bab340a1 | 153:a5ea79f3221f |
|---|---|
| 14 usage = '%prog [options] ...' | 14 usage = '%prog [options] ...' |
| 15 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): | 15 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): |
| 16 """description formatter""" | 16 """description formatter""" |
| 17 def format_description(self, description): | 17 def format_description(self, description): |
| 18 if description: | 18 if description: |
| 19 return description + '\n' | 19 return description.strip() + '\n' |
| 20 else: | 20 else: |
| 21 return '' | 21 return '' |
| 22 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) | 22 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) |
| 23 options, args = parser.parse_args(args) | 23 options, args = parser.parse_args(args) |
| 24 | 24 |
