Render a concise two-column summary of the current configuration. Returns an empty string if nothing meaningful to show.
(self)
| 444 | target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) |
| 445 | |
| 446 | def as_summary(self) -> str: |
| 447 | """ |
| 448 | Render a concise two-column summary of the current configuration. |
| 449 | |
| 450 | Returns an empty string if nothing meaningful to show. |
| 451 | """ |
| 452 | cfg: dict[str, str | list[str] | bool] = {} |
| 453 | |
| 454 | for key, value in self.plain_cfg().items(): |
| 455 | cfg[key.text()] = value |
| 456 | |
| 457 | for config_type, obj in self.sub_cfg().items(): |
| 458 | if not hasattr(obj, 'summary'): |
| 459 | continue |
| 460 | |
| 461 | summary = obj.summary() |
| 462 | if summary: |
| 463 | cfg[config_type.text()] = summary |
| 464 | |
| 465 | simple_summary = as_key_value_pair(cfg, ignore_empty=True) |
| 466 | |
| 467 | return simple_summary |
| 468 | |
| 469 | |
| 470 | class ArchConfigHandler: |
no test coverage detected