Gelatin.generator package

Module contents

Gelatin.generator.new(format)[source]

Gelatin.generator.Builder module

class Gelatin.generator.Builder.Builder[source]

Bases: object

Abstract base class for all generators.

__init__()[source]
add(path, data=None, replace=False)[source]

Creates the given node if it does not exist. Returns the (new or existing) node.

add_attribute(path, name, value)[source]

Creates the given attribute and sets it to the given value. Returns the (new or existing) node to which the attribute was added.

create(path, data=None)[source]

Creates the given node, regardless of whether or not it already exists. Returns the new node.

dump()[source]
enter(path)[source]

Enters the given node. Creates it if it does not exist. Returns the node.

leave()[source]

Returns to the node that was selected before the last call to enter(). The history is a stack, to the method may be called multiple times.

open(path)[source]

Creates and enters the given node, regardless of whether it already exists. Returns the new node.

serialize(serializer)[source]
serialize_to_file(filename)[source]
class Gelatin.generator.Builder.Node(name, attribs=None)[source]

Bases: object

__init__(name, attribs=None)[source]
add(child)[source]
dump(indent=0)[source]
get_child(name, attribs=None)[source]

Returns the first child that matches the given name and attributes.

to_dict()[source]
class Gelatin.generator.Builder.OrderedDefaultDict(default_factory=None, *a, **kw)[source]

Bases: collections.OrderedDict

__init__(default_factory=None, *a, **kw)[source]
copy()[source]
Gelatin.generator.Builder.nodehash(name, attribs)[source]

Gelatin.generator.Dummy module

class Gelatin.generator.Dummy.Dummy[source]

Bases: Gelatin.generator.Builder.Builder

__init__()[source]
add(path, data=None, replace=False)[source]
add_attribute(path, name, value)[source]
dump()[source]
enter(path)[source]
leave()[source]
open(path)[source]
serialize()[source]

Gelatin.generator.Json module

class Gelatin.generator.Json.Json[source]

Bases: object

serialize_doc(node)[source]

Gelatin.generator.Xml module

class Gelatin.generator.Xml.Xml[source]

Bases: object

serialize_doc(node)[source]
serialize_node(node)[source]

Gelatin.generator.Yaml module

class Gelatin.generator.Yaml.Yaml[source]

Bases: object

serialize_doc(node)[source]
Gelatin.generator.Yaml.represent_ordereddict(dumper, data)[source]