From: W. Trevor King Date: Tue, 3 Aug 2010 00:50:55 +0000 (-0400) Subject: Don't save non-string portions of *.info in playlist xml files X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5ad6ee2470691f72b948a9ccf0a3208937166d2e;p=hooke.git Don't save non-string portions of *.info in playlist xml files --- diff --git a/hooke/playlist.py b/hooke/playlist.py index c57604f..d39938d 100644 --- a/hooke/playlist.py +++ b/hooke/playlist.py @@ -24,6 +24,7 @@ import copy import hashlib import os.path +import types import xml.dom.minidom from . import curve as curve @@ -231,6 +232,9 @@ class FilePlaylist (Playlist): root.setAttribute('version', self.version) # store playlist version root.setAttribute('index', str(self._index)) for key,value in self.info.items(): # save info variables + if (key in self._ignored_keys + or not isinstance(value, types.StringTypes)): + continue root.setAttribute(self._clean_key(key), str(value)) for curve in self: # save curves and their attributes curve_element = doc.createElement('curve') @@ -244,7 +248,8 @@ class FilePlaylist (Playlist): os.path.expanduser(self.path)))) curve_element.setAttribute('path', path) for key,value in curve.info.items(): - if key in self._ignored_keys: + if (key in self._ignored_keys + or not isinstance(value, types.StringTypes)): continue curve_element.setAttribute(self._clean_key(key), str(value)) string = doc.toprettyxml(encoding='utf-8') diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index 9059b8c..c3a9f45 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -416,7 +416,6 @@ class HookeFrame (wx.Frame): else: raise NotImplementedError() if 'note' in self._c: - print sorted(curve.info.keys()) self._c['note'].set_text(curve.info['note']) if 'playlist' in self._c: self._c['playlist']._c['tree'].set_selected_curve(