projects
/
python-bulletml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BulletML.FromDocument: Type detector. Various setstate bug fixes.
[python-bulletml.git]
/
bulletml
/
bulletyaml.py
diff --git
a/bulletml/bulletyaml.py
b/bulletml/bulletyaml.py
index
ea45436
..
40949bb
100644
(file)
--- a/
bulletml/bulletyaml.py
+++ b/
bulletml/bulletyaml.py
@@
-33,13
+33,16
@@
def register(Loader=None, Dumper=None):
parser.BulletML]:
def add(cls, loader, dumper):
parser.BulletML]:
def add(cls, loader, dumper):
+ """Register a class in a new variable scope."""
tag = "!" + cls.__name__
if loader:
def construct(loader, node):
tag = "!" + cls.__name__
if loader:
def construct(loader, node):
+ """Construct an object."""
return loader.construct_yaml_object(node, cls)
loader.add_constructor(tag, construct)
if dumper:
def represent(dumper, obj):
return loader.construct_yaml_object(node, cls)
loader.add_constructor(tag, construct)
if dumper:
def represent(dumper, obj):
+ """Represent an object."""
return dumper.represent_yaml_object(tag, obj, cls)
dumper.add_representer(cls, represent)
return dumper.represent_yaml_object(tag, obj, cls)
dumper.add_representer(cls, represent)