| 1 | # SPDX-License-Identifier: MIT |
| 2 | |
| 3 | __all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', |
| 4 | 'CBaseDumper', 'CSafeDumper', 'CDumper'] |
| 5 | |
| 6 | from _yaml import CParser, CEmitter |
| 7 | |
| 8 | from .constructor import * |
| 9 | |
| 10 | from .serializer import * |
| 11 | from .representer import * |
| 12 | |
| 13 | from .resolver import * |
| 14 | |
| 15 | class CBaseLoader(CParser, BaseConstructor, BaseResolver): |
| 16 | |
| 17 | def __init__(self, stream): |
| 18 | CParser.__init__(self, stream) |
| 19 | BaseConstructor.__init__(self) |
| 20 | BaseResolver.__init__(self) |
| 21 | |
| 22 | class CSafeLoader(CParser, SafeConstructor, Resolver): |
| 23 | |
| 24 | def __init__(self, stream): |
| 25 | CParser.__init__(self, stream) |
| 26 | SafeConstructor.__init__(self) |
| 27 | Resolver.__init__(self) |
| 28 | |
| 29 | class CLoader(CParser, Constructor, Resolver): |
| 30 | |
| 31 | def __init__(self, stream): |
| 32 | CParser.__init__(self, stream) |
| 33 | Constructor.__init__(self) |
| 34 | Resolver.__init__(self) |
| 35 | |
| 36 | class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): |
| 37 | |
| 38 | def __init__(self, stream, |
| 39 | default_style=None, default_flow_style=None, |
| 40 | canonical=None, indent=None, width=None, |
| 41 | allow_unicode=None, line_break=None, |
| 42 | encoding=None, explicit_start=None, explicit_end=None, |
| 43 | version=None, tags=None): |
| 44 | CEmitter.__init__(self, stream, canonical=canonical, |
| 45 | indent=indent, width=width, encoding=encoding, |
| 46 | allow_unicode=allow_unicode, line_break=line_break, |
| 47 | explicit_start=explicit_start, explicit_end=explicit_end, |
| 48 | version=version, tags=tags) |
| 49 | Representer.__init__(self, default_style=default_style, |
| 50 | default_flow_style=default_flow_style) |
| 51 | Resolver.__init__(self) |
| 52 | |
| 53 | class CSafeDumper(CEmitter, SafeRepresenter, Resolver): |
| 54 | |
| 55 | def __init__(self, stream, |
| 56 | default_style=None, default_flow_style=None, |
| 57 | canonical=None, indent=None, width=None, |
| 58 | allow_unicode=None, line_break=None, |
| 59 | encoding=None, explicit_start=None, explicit_end=None, |
| 60 | version=None, tags=None): |
| 61 | CEmitter.__init__(self, stream, canonical=canonical, |
| 62 | indent=indent, width=width, encoding=encoding, |
| 63 | allow_unicode=allow_unicode, line_break=line_break, |
| 64 | explicit_start=explicit_start, explicit_end=explicit_end, |
| 65 | version=version, tags=tags) |
| 66 | SafeRepresenter.__init__(self, default_style=default_style, |
| 67 | default_flow_style=default_flow_style) |
| 68 | Resolver.__init__(self) |
| 69 | |
| 70 | class CDumper(CEmitter, Serializer, Representer, Resolver): |
| 71 | |
| 72 | def __init__(self, stream, |
| 73 | default_style=None, default_flow_style=None, |
| 74 | canonical=None, indent=None, width=None, |
| 75 | allow_unicode=None, line_break=None, |
| 76 | encoding=None, explicit_start=None, explicit_end=None, |
| 77 | version=None, tags=None): |
| 78 | CEmitter.__init__(self, stream, canonical=canonical, |
| 79 | indent=indent, width=width, encoding=encoding, |
| 80 | allow_unicode=allow_unicode, line_break=line_break, |
| 81 | explicit_start=explicit_start, explicit_end=explicit_end, |
| 82 | version=version, tags=tags) |
| 83 | Representer.__init__(self, default_style=default_style, |
| 84 | default_flow_style=default_flow_style) |
| 85 | Resolver.__init__(self) |
| 86 |