Esempio n. 1
0
    def store_option_strings(self, parser):
        old_help_position = self.help_position
        HelpFormatter.store_option_strings(self, parser)
        new_help_position = self.help_position

        if new_help_position < old_help_position:
            self.help_position = old_help_position
Esempio n. 2
0
 def __init__(self,
              indent_increment=1,
              max_help_position=48,
              width=200,
              short_first=1):
     HelpFormatter.__init__(self, indent_increment, max_help_position,
                            width, short_first)
Esempio n. 3
0
 def __init__(self,
              indent_increment=0,
              max_help_position=24,
              width=None,
              short_first=1):
     HelpFormatter.__init__(self, indent_increment, max_help_position,
                            width, short_first)
Esempio n. 4
0
 def __init__ (self,
               indent_increment=0,
               max_help_position=24,
               width=79,
               short_first=0):
     HelpFormatter.__init__ (
         self, indent_increment, max_help_position, width, short_first)
Esempio n. 5
0
    def store_option_strings(self, parser):
        old_help_position = self.help_position
        HelpFormatter.store_option_strings(self, parser)
        new_help_position = self.help_position

        if new_help_position < old_help_position:
            self.help_position = old_help_position
Esempio n. 6
0
 def __init__(self,
              indent_increment=1,
              max_help_position=48,
              width=200,
              short_first=1):
     HelpFormatter.__init__ (
         self, indent_increment, max_help_position, width, short_first)
Esempio n. 7
0
 def __init__(self,
        indent_increment=2,
        max_help_position=24,
        width=None,
        short_first=1):
   HelpFormatter.__init__(
     self, indent_increment, max_help_position, width, short_first)
   self._dl_open = False
Esempio n. 8
0
 def __init__(
     self,
     indent_increment: int = 0,
     max_help_position: int = 24,
     width: int = 79,
     short_first: int = 0,
 ) -> None:
     HelpFormatter.__init__(self, indent_increment, max_help_position, width, short_first)
Esempio n. 9
0
    def format_option_strings(self, option):
        if hasattr(option, "subopt") and option.subopt:
            res = '-o ' + option.subopt
            if option.takes_value():
                res += "="
                res += option.metavar or 'FOO'
            return res

        return HelpFormatter.format_option_strings(self, option)
Esempio n. 10
0
    def format_option_strings(self, option):
        if hasattr(option, "subopt") and option.subopt:
            res = '-o ' + option.subopt
            if option.takes_value():
                res += "="
                res += option.metavar or 'FOO'
            return res

        return HelpFormatter.format_option_strings(self, option)
Esempio n. 11
0
 def format_option_strings(self, option):
     if isinstance(option, GroupOption):
         if option.takes_value():
             metavar = option.metavar or option.dest.upper()
             return '%s=%s' % (
                 option._long_opts[0],
                 metavar,
             )
         else:
             return option._long_opts[0]
     else:
         return HelpFormatter.format_option_strings(self, option)
Esempio n. 12
0
 def format_option_strings(self, option):
     if isinstance(option, GroupOption):
         if option.takes_value():
             metavar = option.metavar or option.dest.upper()
             return '%s=%s' % (
               option._long_opts[0],
               metavar,
             )
         else:
             return option._long_opts[0]
     else:
         return HelpFormatter.format_option_strings(self, option)
Esempio n. 13
0
 def __init__(self, *args, **kwargs):
     HelpFormatter.__init__(self, *args, **kwargs)
     self.help_position = 0
Esempio n. 14
0
 def indent(self):
   self._pending = 'INDENT'
   HelpFormatter.indent(self)
Esempio n. 15
0
 def __init__(self, *args, **kwargs):
     HelpFormatter.__init__(self, *args, **kwargs)
     self.help_position = 0
Esempio n. 16
0
 def dedent(self):
     self._pending = 'DEDENT'
     HelpFormatter.dedent(self)
Esempio n. 17
0
 def indent(self):
     self._pending = 'INDENT'
     HelpFormatter.indent(self)
Esempio n. 18
0
 def dedent(self):
   self._pending = 'DEDENT'
   HelpFormatter.dedent(self)