+# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+#
+# This file is part of Hooke.
+#
+# Hooke is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later version.
+#
+# Hooke is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Hooke. If not, see
+# <http://www.gnu.org/licenses/>.
+
"""The `playlist` module provides a :class:`Playlist` and its subclass
:class:`FilePlaylist` for manipulating lists of
:class:`hooke.curve.Curve`\s.
if path != None:
if not path.endswith('.hkp'):
path += '.hkp'
+ self.path = path
if self.name == None:
- name = os.path.basename(path)
+ self.name = os.path.basename(path)
def is_saved(self):
return self.digest() == self._digest
path/to/curve/two
"""
doc = xml.dom.minidom.parseString(string)
- return self._from_xml_doc(doc)
+ self._from_xml_doc(doc)
def load(self, path=None):
"""Load a playlist from a file.
"""
self.set_path(path)
doc = xml.dom.minidom.parse(self.path)
- return self._from_xml_doc(doc)
+ self._from_xml_doc(doc)
+ self._digest = self.digest()
def save(self, path=None):
"""Saves the playlist in a XML file.