+ # Late import to avoid a circular dependency.
+ try:
+ import bulletml.bulletyaml
+ import yaml
+ except ImportError:
+ raise ParseError("PyYAML is not available")
+ else:
+ try:
+ return yaml.load(source)
+ except Exception, exc:
+ raise ParseError(str(exc))
+
+ @classmethod
+ def FromDocument(cls, source):
+ """Create a BulletML instance based on a seekable file or string.