def __init__(self, app=None, validator=None, mime_type=None, ignore_uncap=False, # DictDocument specific ignore_wrappers=True, complex_as=dict, ordered=False, # YamlDocument specific safe=True, **kwargs): HierDictDocument.__init__(self, app, validator, mime_type, ignore_uncap, ignore_wrappers, complex_as, ordered) self._from_string_handlers[Double] = lambda cls, val: val self._from_string_handlers[Boolean] = lambda cls, val: val self._from_string_handlers[Integer] = lambda cls, val: val self._to_string_handlers[Double] = lambda cls, val: val self._to_string_handlers[Boolean] = lambda cls, val: val self._to_string_handlers[Integer] = lambda cls, val: val self.in_kwargs = dict(kwargs) self.out_kwargs = dict(kwargs) self.in_kwargs['Loader'] = Loader self.out_kwargs['Dumper'] = Dumper if safe: self.in_kwargs['Loader'] = SafeLoader self.out_kwargs['Dumper'] = SafeDumper if not 'indent' in self.out_kwargs: self.out_kwargs['indent'] = 4 if not 'default_flow_style' in self.out_kwargs: self.out_kwargs['default_flow_style'] = False
def __init__(self, app=None, validator=None, mime_type=None, ignore_uncap=False, # DictDocument specific ignore_wrappers=True, complex_as=dict, ordered=False): HierDictDocument.__init__(self, app, validator, mime_type, ignore_uncap, ignore_wrappers, complex_as, ordered) self._from_string_handlers[Double] = lambda cls, val: val self._from_string_handlers[Boolean] = lambda cls, val: val self._from_string_handlers[Integer] = lambda cls, val: val self._to_string_handlers[Double] = lambda cls, val: val self._to_string_handlers[Boolean] = lambda cls, val: val self._to_string_handlers[Integer] = lambda cls, val: val
def __init__(self, app=None, validator=None, mime_type=None, ignore_uncap=False, # DictDocument specific ignore_wrappers=True, complex_as=dict, ordered=False): HierDictDocument.__init__(self, app, validator, mime_type, ignore_uncap, ignore_wrappers, complex_as, ordered) self._from_string_handlers[Double] = lambda cls, val: val self._from_string_handlers[Boolean] = lambda cls, val: val self._from_string_handlers[Integer] = lambda cls, val: val self._to_string_handlers[Double] = lambda cls, val: val self._to_string_handlers[Boolean] = lambda cls, val: val self._to_string_handlers[Integer] = lambda cls, val: val
def __init__( self, app=None, validator=None, mime_type=None, ignore_uncap=False, # DictDocument specific ignore_wrappers=True, complex_as=dict, ordered=False, # YamlDocument specific safe=True, **kwargs): HierDictDocument.__init__(self, app, validator, mime_type, ignore_uncap, ignore_wrappers, complex_as, ordered) self._from_string_handlers[Double] = lambda cls, val: val self._from_string_handlers[Boolean] = lambda cls, val: val self._from_string_handlers[Integer] = lambda cls, val: val self._to_string_handlers[Double] = lambda cls, val: val self._to_string_handlers[Boolean] = lambda cls, val: val self._to_string_handlers[Integer] = lambda cls, val: val self.in_kwargs = dict(kwargs) self.out_kwargs = dict(kwargs) self.in_kwargs['Loader'] = Loader self.out_kwargs['Dumper'] = Dumper if safe: self.in_kwargs['Loader'] = SafeLoader self.out_kwargs['Dumper'] = SafeDumper if not 'indent' in self.out_kwargs: self.out_kwargs['indent'] = 4 if not 'default_flow_style' in self.out_kwargs: self.out_kwargs['default_flow_style'] = False
def __init__(self, app=None, validator=None, mime_type=None, ignore_uncap=False, # DictDocument specific ignore_wrappers=True, complex_as=dict, ordered=False, default_string_encoding=None, **kwargs): HierDictDocument.__init__(self, app, validator, mime_type, ignore_uncap, ignore_wrappers, complex_as, ordered) # this is needed when we're overriding a regular instance attribute # with a property. self.__message = HierDictDocument.__getattribute__(self, 'message') self._from_string_handlers[Double] = lambda cls, val: val self._from_string_handlers[Boolean] = lambda cls, val: val self._from_string_handlers[Integer] = lambda cls, val: val self._to_string_handlers[Double] = lambda cls, val: val self._to_string_handlers[Boolean] = lambda cls, val: val self._to_string_handlers[Integer] = lambda cls, val: val self.default_string_encoding = default_string_encoding self.kwargs = kwargs