How to use the srsly.ruamel_yaml.constructor.RoundTripConstructor.add_constructor 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
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
)

RoundTripConstructor.add_constructor(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
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
)

RoundTripConstructor.add_constructor(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
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
)

RoundTripConstructor.add_constructor(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
# 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
)

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

RoundTripConstructor.add_constructor(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
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
)

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
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
)

RoundTripConstructor.add_constructor(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
if values["tz"]:  # no delta
                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(
github explosion / srsly / srsly / ruamel_yaml / constructor.py View on Github external
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
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
)

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
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)