Don't save digests in the playlist file.
authorW. Trevor King <wking@drexel.edu>
Tue, 9 Nov 2010 21:18:06 +0000 (16:18 -0500)
committerW. Trevor King <wking@drexel.edu>
Tue, 9 Nov 2010 21:18:06 +0000 (16:18 -0500)
They create dependency loops:
  digest_{i+1} = checksum(file with digest_i)
With the old way, exiting after
  $ hk.py -c 'new_playlist --output_playlist mylist'
          -c 'glob_curves_to_playlist ...*.curve'
          -c 'save_playlist --output mylist' -p
would complain of unsaved playlists.

hooke/playlist.py

index 1543b9f63e617884e033ccfba5cc758148e28dce..3b5c8743ba30c04908f32effde1eec80ceafc49c 100644 (file)
@@ -463,8 +463,10 @@ class FilePlaylist (Playlist):
         self._relative_curve_paths = self.relative_curve_paths
         self.update_curve_paths()
         self._relative_curve_paths = rcp
-
+        digest = self._digest
+        self._digest = None  # don't save the digest (recursive file).
         yaml_string = yaml.dump(self, allow_unicode=True)
+        self._digest = digest
         self.update_curve_paths()
         return ('# Hooke playlist version %s\n' % self.version) + yaml_string