Return an appropriate-for-serialization version of this object. See the documentation for `.Program` and its ``json`` task listing format; this method is the driver for that functionality. .. versionadded:: 1.0
(self)
| 579 | merge_dicts(self._configuration, options) |
| 580 | |
| 581 | def serialized(self) -> Dict[str, Any]: |
| 582 | """ |
| 583 | Return an appropriate-for-serialization version of this object. |
| 584 | |
| 585 | See the documentation for `.Program` and its ``json`` task listing |
| 586 | format; this method is the driver for that functionality. |
| 587 | |
| 588 | .. versionadded:: 1.0 |
| 589 | """ |
| 590 | return { |
| 591 | "name": self.name, |
| 592 | "help": helpline(self), |
| 593 | "default": self.default, |
| 594 | "tasks": [ |
| 595 | { |
| 596 | "name": self.transform(x.name), |
| 597 | "help": helpline(x), |
| 598 | "aliases": [self.transform(y) for y in x.aliases], |
| 599 | } |
| 600 | for x in sorted(self.tasks.values(), key=lambda x: x.name) |
| 601 | ], |
| 602 | "collections": [ |
| 603 | x.serialized() |
| 604 | for x in sorted( |
| 605 | self.collections.values(), key=lambda x: x.name or "" |
| 606 | ) |
| 607 | ], |
| 608 | } |
no test coverage detected