MCPcopy Index your code
hub / github.com/python/cpython / store_option_strings

Method store_option_strings

Lib/optparse.py:319–335  ·  view source on GitHub ↗
(self, parser)

Source from the content-addressed store, hash-verified

317 return "".join(result)
318
319 def store_option_strings(self, parser):
320 self.indent()
321 max_len = 0
322 for opt in parser.option_list:
323 strings = self.format_option_strings(opt)
324 self.option_strings[opt] = strings
325 max_len = max(max_len, len(strings) + self.current_indent)
326 self.indent()
327 for group in parser.option_groups:
328 for opt in group.option_list:
329 strings = self.format_option_strings(opt)
330 self.option_strings[opt] = strings
331 max_len = max(max_len, len(strings) + self.current_indent)
332 self.dedent()
333 self.dedent()
334 self.help_position = min(max_len + 2, self.max_help_position)
335 self.help_width = max(self.width - self.help_position, 11)
336
337 def format_option_strings(self, option):
338 """Return a comma-separated list of option strings & metavariables."""

Callers 1

format_option_helpMethod · 0.80

Calls 3

indentMethod · 0.95
format_option_stringsMethod · 0.95
dedentMethod · 0.95

Tested by

no test coverage detected