MCPcopy
hub / github.com/google/python-fire / _MakeUsageDetailsSection

Function _MakeUsageDetailsSection

fire/helptext.py:576–594  ·  view source on GitHub ↗

Creates a usage details section for the provided action group.

(action_group)

Source from the content-addressed store, hash-verified

574
575
576def _MakeUsageDetailsSection(action_group):
577 """Creates a usage details section for the provided action group."""
578 item_strings = []
579 for name, member in action_group.GetItems():
580 info = inspectutils.Info(member)
581 item = name
582 docstring_info = info.get('docstring_info')
583 if (docstring_info
584 and not custom_descriptions.NeedsCustomDescription(member)):
585 summary = docstring_info.summary
586 elif custom_descriptions.NeedsCustomDescription(member):
587 summary = custom_descriptions.GetSummary(
588 member, LINE_LENGTH - SECTION_INDENTATION, LINE_LENGTH)
589 else:
590 summary = None
591 item = _CreateItem(name, summary)
592 item_strings.append(item)
593 return (action_group.plural.upper(),
594 _NewChoicesSection(action_group.name.upper(), item_strings))
595
596
597def _ValuesUsageDetailsSection(component, values):

Callers 1

_UsageDetailsSectionsFunction · 0.85

Calls 4

_CreateItemFunction · 0.85
_NewChoicesSectionFunction · 0.85
GetItemsMethod · 0.80
upperMethod · 0.80

Tested by

no test coverage detected