try:
self.__dict__.update(state)
except TypeError, e:
- print state, type(state), e
+ print(' '.join(str(x) for x in [state, type(state), e]))
if self.info in [None, {}]:
self.info = {}
Examples
--------
- >>> print playlist_path('playlist')
+ >>> print(playlist_path('playlist'))
playlist.hkp
- >>> print playlist_path('playlist.hkp')
+ >>> print(playlist_path('playlist.hkp'))
playlist.hkp
- >>> print playlist_path(None)
+ >>> print(playlist_path(None))
None
"""
if path == None:
>>> s = pickle.dumps(p)
>>> z = pickle.loads(s)
>>> for curve in z:
- ... print curve
+ ... print(curve)
<Curve A>
<Curve B>
- >>> print z.drivers
+ >>> print(z.drivers)
['Driver A', 'Driver B']
The data-type is also YAMLable (see :mod:`hooke.util.yaml`).
>>> s = yaml.dump(p)
>>> z = yaml.load(s)
>>> for curve in z:
- ... print curve
+ ... print(curve)
<Curve A>
<Curve B>
- >>> print z.drivers
+ >>> print(z.drivers)
['Driver A', 'Driver B']
"""
version = '0.2'
... CommandMessage('command B', {'arg 0':1, 'curve':c}),
... ])
>>> p.append_curve(c)
- >>> print p.flatten() # doctest: +REPORT_UDIFF
+ >>> print(p.flatten()) # doctest: +REPORT_UDIFF
# Hooke playlist version 0.2
!!python/object/new:hooke.playlist.FilePlaylist
listitems:
version: '0.2'
<BLANKLINE>
>>> p.relative_curve_paths = False
- >>> print p.flatten() # doctest: +REPORT_UDIFF
+ >>> print(p.flatten()) # doctest: +REPORT_UDIFF
# Hooke playlist version 0.2
!!python/object/new:hooke.playlist.FilePlaylist
listitems:
>>> p = from_string(string)
>>> p.set_path('/path/to/playlist')
>>> for curve in p:
- ... print curve.name, curve.path
+ ... print('{} {}'.format(curve.name, curve.path))
one /path/to/curve/one
two /path/to/curve/two
>>> p.info
{'note': 'An example playlist'}
>>> for curve in p:
- ... print curve.name, curve.path
+ ... print('{} {}'.format(curve.name, curve.path))
one /path/to/curve/one
two /path/to/curve/two
>>> p[-1].info['attr with spaces']