dumper.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. __all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
  2. from .emitter import *
  3. from .serializer import *
  4. from .representer import *
  5. from .resolver import *
  6. class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
  7. def __init__(self, stream,
  8. default_style=None, default_flow_style=False,
  9. canonical=None, indent=None, width=None,
  10. allow_unicode=None, line_break=None,
  11. encoding=None, explicit_start=None, explicit_end=None,
  12. version=None, tags=None, sort_keys=True):
  13. Emitter.__init__(self, stream, canonical=canonical,
  14. indent=indent, width=width,
  15. allow_unicode=allow_unicode, line_break=line_break)
  16. Serializer.__init__(self, encoding=encoding,
  17. explicit_start=explicit_start, explicit_end=explicit_end,
  18. version=version, tags=tags)
  19. Representer.__init__(self, default_style=default_style,
  20. default_flow_style=default_flow_style, sort_keys=sort_keys)
  21. Resolver.__init__(self)
  22. class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):
  23. def __init__(self, stream,
  24. default_style=None, default_flow_style=False,
  25. canonical=None, indent=None, width=None,
  26. allow_unicode=None, line_break=None,
  27. encoding=None, explicit_start=None, explicit_end=None,
  28. version=None, tags=None, sort_keys=True):
  29. Emitter.__init__(self, stream, canonical=canonical,
  30. indent=indent, width=width,
  31. allow_unicode=allow_unicode, line_break=line_break)
  32. Serializer.__init__(self, encoding=encoding,
  33. explicit_start=explicit_start, explicit_end=explicit_end,
  34. version=version, tags=tags)
  35. SafeRepresenter.__init__(self, default_style=default_style,
  36. default_flow_style=default_flow_style, sort_keys=sort_keys)
  37. Resolver.__init__(self)
  38. class Dumper(Emitter, Serializer, Representer, Resolver):
  39. def __init__(self, stream,
  40. default_style=None, default_flow_style=False,
  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, sort_keys=True):
  45. Emitter.__init__(self, stream, canonical=canonical,
  46. indent=indent, width=width,
  47. allow_unicode=allow_unicode, line_break=line_break)
  48. Serializer.__init__(self, encoding=encoding,
  49. explicit_start=explicit_start, explicit_end=explicit_end,
  50. version=version, tags=tags)
  51. Representer.__init__(self, default_style=default_style,
  52. default_flow_style=default_flow_style, sort_keys=sort_keys)
  53. Resolver.__init__(self)