File: commandLineArguments.py

package info (click to toggle)
subuser 0.6.2-3
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 4,208 kB
  • sloc: python: 5,201; sh: 380; makefile: 73
file content (25 lines) | stat: -rwxr-xr-x 751 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
"""
This module contains configurations for C{optparse}.
"""

#external imports
import optparse
#internal imports
#import ...

class HelpFormatterThatDoesntReformatDescription (optparse.HelpFormatter):
  """
  Format help with indented section bodies but don't reformat the description.
  """
  def __init__(self, indent_increment=2, max_help_position=24, width=None,short_first=1):
    optparse.HelpFormatter.__init__(self, indent_increment, max_help_position, width, short_first)

  def format_usage(self, usage):
    return optparse._("Usage: %s\n") % usage

  def format_heading(self, heading):
    return "%*s%s:\n" % (self.current_indent, "", heading)

  def format_description(self, description):
    return description