Action: Don't need the owner in the constructor. Factory function to create a child.
[python-bulletml.git] / bulletml / bulletyaml.py
index ea45436..2503c9d 100644 (file)
@@ -13,7 +13,7 @@ Example BulletYAML document:
     !BulletML
     type: vertical
     actions:
-      top: !ActionDef
+      - !ActionDef
         actions:
         - !FireDef
           bullet: !BulletDef {}
@@ -33,13 +33,16 @@ def register(Loader=None, Dumper=None):
                 parser.BulletML]:
 
         def add(cls, loader, dumper):
+            """Register a class in a new variable scope."""
             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):
+                    """Represent an object."""
                     return dumper.represent_yaml_object(tag, obj, cls)
                 dumper.add_representer(cls, represent)