From 799d4c2811ccbee08e926d52b832c7c8cb031cc1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 2 Aug 2010 20:50:55 -0400 Subject: [PATCH] Don't save non-string portions of *.info in playlist xml files --- hooke/playlist.py | 7 ++++++- hooke/ui/gui/__init__.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) 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( -- 2.26.2