| Conditions | 1 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 23 | def announce_class( |
||
| 24 | cls: type, |
||
| 25 | cls_name: Optional[str] = None, |
||
| 26 | fork_inst: type = StateHolder): |
||
| 27 | """ |
||
| 28 | Announce the given cls to jsons to allow jsons to deserialize a verbose |
||
| 29 | dump into that class. |
||
| 30 | :param cls: the class that is to be announced. |
||
| 31 | :param cls_name: a custom name for that class. |
||
| 32 | :param fork_inst: if given, it uses this fork of ``JsonSerializable``. |
||
| 33 | :return: None. |
||
| 34 | """ |
||
| 35 | cls_name = cls_name or get_class_name(cls, fully_qualified=True, |
||
| 36 | fork_inst=fork_inst) |
||
| 37 | fork_inst._announced_classes[cls] = cls_name |
||
| 38 | fork_inst._announced_classes[cls_name] = cls |
||
| 39 |