From: W. Trevor King Date: Tue, 1 Jun 2010 15:42:53 +0000 (-0400) Subject: Correct relative path generation in hooke.playlist.FilePlaylist.flatten X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ad665146fb2f06fbba7cd78af3ce38fde7cf49ff;p=hooke.git Correct relative path generation in hooke.playlist.FilePlaylist.flatten --- diff --git a/hooke/playlist.py b/hooke/playlist.py index 336c344..963d935 100644 --- a/hooke/playlist.py +++ b/hooke/playlist.py @@ -149,7 +149,7 @@ class FilePlaylist (Playlist): >>> 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() @@ -184,8 +184,8 @@ class FilePlaylist (Playlist): >>> print p.flatten() # doctest: +NORMALIZE_WHITESPACE +REPORT_UDIFF - - + + >>> print p.flatten(absolute_paths=True) # doctest: +NORMALIZE_WHITESPACE +REPORT_UDIFF @@ -211,7 +211,9 @@ class FilePlaylist (Playlist): 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))