示例#1
0
文件: toc.py 项目: doytsujin/docs
def _dict_representer(dumper: yaml.SafeDumper, data: Any):
    """Represent the object as a dict created of (key, value) pairs."""
    return dumper.represent_dict(iter(data))
示例#2
0
def command_shortcut_representer(dumper: SafeDumper,
                                 data: CommandShortcutModel):
    return dumper.represent_dict(data.__dict__)