How to use the srsly.ruamel_yaml.constructor.RoundTripConstructor function in srsly

To help you get started, we’ve selected a few srsly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:bool", RoundTripConstructor.construct_yaml_bool
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:int", RoundTripConstructor.construct_yaml_int
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:timestamp", RoundTripConstructor.construct_yaml_timestamp
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:omap", RoundTripConstructor.construct_yaml_omap
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:pairs", RoundTripConstructor.construct_yaml_pairs
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:set", RoundTripConstructor.construct_yaml_set
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:set", RoundTripConstructor.construct_yaml_set
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:str", RoundTripConstructor.construct_yaml_str
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:seq", RoundTripConstructor.construct_yaml_seq
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:map", RoundTripConstructor.construct_yaml_map
)

RoundTripConstructor.add_constructor(None, RoundTripConstructor.construct_undefined)
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
b = SafeConstructor.construct_yaml_bool(self, node)
        if node.anchor:
            return ScalarBoolean(b, anchor=node.anchor)
        return b


RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:null", RoundTripConstructor.construct_yaml_null
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:bool", RoundTripConstructor.construct_yaml_bool
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:int", RoundTripConstructor.construct_yaml_int
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:timestamp", RoundTripConstructor.construct_yaml_timestamp
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:omap", RoundTripConstructor.construct_yaml_omap
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:pairs", RoundTripConstructor.construct_yaml_pairs
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:set", RoundTripConstructor.construct_yaml_set
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:str", RoundTripConstructor.construct_yaml_str
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:seq", RoundTripConstructor.construct_yaml_seq
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:map", RoundTripConstructor.construct_yaml_map
)

RoundTripConstructor.add_constructor(None, RoundTripConstructor.construct_undefined)
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:null", RoundTripConstructor.construct_yaml_null
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:bool", RoundTripConstructor.construct_yaml_bool
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:int", RoundTripConstructor.construct_yaml_int
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:timestamp", RoundTripConstructor.construct_yaml_timestamp
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:omap", RoundTripConstructor.construct_yaml_omap
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:pairs", RoundTripConstructor.construct_yaml_pairs
github explosion / srsly / srsly / ruamel_yaml / loader.py View on Github external
Composer.__init__(self, loader=self)
        SafeConstructor.__init__(self, loader=self)
        VersionedResolver.__init__(self, version, loader=self)


class Loader(Reader, Scanner, Parser, Composer, Constructor, VersionedResolver):
    def __init__(self, stream, version=None, preserve_quotes=None):
        raise ValueError("Unsafe loader not implemented in this library.")


class RoundTripLoader(
    Reader,
    RoundTripScanner,
    RoundTripParser,
    Composer,
    RoundTripConstructor,
    VersionedResolver,
):
    def __init__(self, stream, version=None, preserve_quotes=None):
        # type: (StreamTextType, Optional[VersionType], Optional[bool]) -> None
        # self.reader = Reader.__init__(self, stream)
        Reader.__init__(self, stream, loader=self)
        RoundTripScanner.__init__(self, loader=self)
        RoundTripParser.__init__(self, loader=self)
        Composer.__init__(self, loader=self)
        RoundTripConstructor.__init__(
            self, preserve_quotes=preserve_quotes, loader=self
        )
        VersionedResolver.__init__(self, version, loader=self)
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:int", RoundTripConstructor.construct_yaml_int
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:timestamp", RoundTripConstructor.construct_yaml_timestamp
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:omap", RoundTripConstructor.construct_yaml_omap
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:pairs", RoundTripConstructor.construct_yaml_pairs
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:set", RoundTripConstructor.construct_yaml_set
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:str", RoundTripConstructor.construct_yaml_str
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
data._yaml["tz"] = values["tz"]

        if values["t"]:
            data._yaml["t"] = True
        return data

    def construct_yaml_bool(self, node):
        # type: (Any) -> Any
        b = SafeConstructor.construct_yaml_bool(self, node)
        if node.anchor:
            return ScalarBoolean(b, anchor=node.anchor)
        return b


RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:null", RoundTripConstructor.construct_yaml_null
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:bool", RoundTripConstructor.construct_yaml_bool
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:int", RoundTripConstructor.construct_yaml_int
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:float", RoundTripConstructor.construct_yaml_float
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:binary", RoundTripConstructor.construct_yaml_binary
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:timestamp", RoundTripConstructor.construct_yaml_timestamp
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:omap", RoundTripConstructor.construct_yaml_omap
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:pairs", RoundTripConstructor.construct_yaml_pairs
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:set", RoundTripConstructor.construct_yaml_set
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:str", RoundTripConstructor.construct_yaml_str
)

RoundTripConstructor.add_constructor(
    u"tag:yaml.org,2002:seq", RoundTripConstructor.construct_yaml_seq