Ran update_copyright.py, updating all the copyright blurbs and adding AUTHORS.
[hooke.git] / hooke / playlist.py
index 7e76c937a7ab5a0d2e974f6ec3768548b5a0e94c..fc4ea9a7d72649ceb2354fcbece4750da829c7d4 100644 (file)
@@ -1,3 +1,21 @@
+# 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.
@@ -83,8 +101,9 @@ class FilePlaylist (Playlist):
         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
@@ -223,14 +242,15 @@ class FilePlaylist (Playlist):
         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.