cyaml.py 3.2 KB

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