if k == 'drivers': # HACK. Need better driver serialization.
continue
try:
- yaml.safe_dump((k,v))
+ yaml.dump((k,v))
except RepresenterError, e:
raise NotImplementedError(
- 'cannot convert %s.%s = %s (%s) to safe YAML'
- % (owner.__class__.__name__, k, v, type(v)))
+ 'cannot convert %s.%s = %s (%s) to YAML\n%s'
+ % (owner.__class__.__name__, k, v, type(v), e))
def _setup_item(self, item):
"""Perform any required initialization before returning an item.
self._ignored_attrs.extend([
'_item_ignored_attrs', '_item_default_attrs',
'_loaded'])
- self._item_ignored_attrs = []
+ self._item_ignored_attrs = ['data']
self._item_default_attrs = {
'command_stack': [],
- 'data': None,
'driver': None,
'info': {},
'name': None,
- info: {note: The first curve}
name: one
path: curve/one
- - command_stack:
- - arguments: {arg 0: 0, arg 1: X}
- command: command A
- - arguments: {arg 0: 1, arg 1: Y}
- command: command B
+ - command_stack: !!python/object/new:hooke.command_stack.CommandStack
+ listitems:
+ - !!python/object:hooke.engine.CommandMessage
+ arguments: {arg 0: 0, arg 1: X}
+ command: command A
+ - !!python/object:hooke.engine.CommandMessage
+ arguments: {arg 0: 1, arg 1: Y}
+ command: command B
info: {attr with spaces: 'The second curve
<BLANKLINE>
with endlines'}
- info: {note: The first curve}
name: one
path: /path/to/curve/one
- - command_stack:
- - arguments: {arg 0: 0, arg 1: X}
- command: command A
- - arguments: {arg 0: 1, arg 1: Y}
- command: command B
+ - command_stack: !!python/object/new:hooke.command_stack.CommandStack
+ listitems:
+ - !!python/object:hooke.engine.CommandMessage
+ arguments: {arg 0: 0, arg 1: X}
+ command: command A
+ - !!python/object:hooke.engine.CommandMessage
+ arguments: {arg 0: 1, arg 1: Y}
+ command: command B
info: {attr with spaces: 'The second curve
<BLANKLINE>
with endlines'}
... items:
... - info: {note: The first curve}
... path: curve/one
- ... - command_stack:
- ... - arguments: {arg 0: 0, arg 1: X}
- ... command: command A
- ... - arguments: {arg 0: 1, arg 1: Y}
- ... command: command B
+ ... - command_stack: !!python/object/new:hooke.command_stack.CommandStack
+ ... listitems:
+ ... - !!python/object:hooke.engine.CommandMessage
+ ... arguments: {arg 0: 0, arg 1: X}
+ ... command: command A
+ ... - !!python/object:hooke.engine.CommandMessage
+ ... arguments: {arg 0: 1, arg 1: Y}
+ ... command: command B
... info: {attr with spaces: 'The second curve
...
... with endlines'}