>>> c.info['note'] = 'The second curve'
>>> p.append(c)
>>> p.digest()
- "\xa1\x99\x8a\x99\xed\xad\x13'\xa7w\x12\x00\x07Z\xb3\xd0zN\xa2\xe1"
+ '\\\x14\x87\x88*q\xf8\xaa\xa7\x84f\x82\xa1S>\xfd3+\xd0o'
"""
string = self.flatten()
return hashlib.sha1(string).digest()
>>> print p.flatten() # doctest: +NORMALIZE_WHITESPACE +REPORT_UDIFF
<?xml version="1.0" encoding="utf-8"?>
<playlist index="0" note="An example playlist" version="0.1">
- <curve note="The first curve" path="../curve/one"/>
- <curve note="The second curve" path="../curve/two"/>
+ <curve note="The first curve" path="curve/one"/>
+ <curve note="The second curve" path="curve/two"/>
</playlist>
<BLANKLINE>
>>> print p.flatten(absolute_paths=True) # doctest: +NORMALIZE_WHITESPACE +REPORT_UDIFF
if absolute_paths == False:
path = os.path.relpath(
path,
- os.path.abspath(os.path.expanduser(self.path)))
+ os.path.dirname(
+ os.path.abspath(
+ os.path.expanduser(self.path))))
curve_element.setAttribute('path', path)
for key,value in curve.info.items():
curve_element.setAttribute(key, str(value))