The "Description" sections of the help string. Args: component: The component to produce the description section for. info: The info dict for the component of interest. Returns: Returns the description if available. If not, returns the summary. If neither are available, returns
(component, info)
| 140 | |
| 141 | |
| 142 | def _DescriptionSection(component, info) -> tuple[str, str] | None: |
| 143 | """The "Description" sections of the help string. |
| 144 | |
| 145 | Args: |
| 146 | component: The component to produce the description section for. |
| 147 | info: The info dict for the component of interest. |
| 148 | |
| 149 | Returns: |
| 150 | Returns the description if available. If not, returns the summary. |
| 151 | If neither are available, returns None. |
| 152 | """ |
| 153 | if custom_descriptions.NeedsCustomDescription(component): |
| 154 | available_space = LINE_LENGTH - SECTION_INDENTATION |
| 155 | description = custom_descriptions.GetDescription(component, available_space, |
| 156 | LINE_LENGTH) |
| 157 | summary = custom_descriptions.GetSummary(component, available_space, |
| 158 | LINE_LENGTH) |
| 159 | else: |
| 160 | description = _GetDescription(info) |
| 161 | summary = _GetSummary(info) |
| 162 | # Fall back to summary if description is not available. |
| 163 | text = description or summary or None |
| 164 | if text: |
| 165 | return ('DESCRIPTION', text) |
| 166 | else: |
| 167 | return None |
| 168 | |
| 169 | |
| 170 | def _CreateKeywordOnlyFlagItem(flag, docstring_info, spec, short_arg): |
no test coverage detected