projects
/
hooke.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0ff44b
)
Clear NoteIndexList in .__setstate__ to avoid doubling items during engine->UI passing.
author
W. Trevor King
<wking@drexel.edu>
Sat, 21 Aug 2010 19:05:41 +0000
(15:05 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Sat, 21 Aug 2010 19:05:41 +0000
(15:05 -0400)
hooke/playlist.py
patch
|
blob
|
history
diff --git
a/hooke/playlist.py
b/hooke/playlist.py
index 3380bfcacfc4ca24a02f4ee49e11c89370fa9cd0..6e8f232c9da0482310408f6fede249c7b8578016 100644
(file)
--- a/
hooke/playlist.py
+++ b/
hooke/playlist.py
@@
-82,6
+82,7
@@
class NoteIndexList (list):
def __setstate__(self, state):
self._set_ignored_attrs()
+ self.clear()
for key,value in self._default_attrs.items():
setattr(self, key, value)
for key,value in state.items():
@@
-113,6
+114,10
@@
class NoteIndexList (list):
"""
pass
+ def clear(self):
+ while len(self) > 0:
+ self.pop()
+
def index(self, value=None, *args, **kwargs):
"""Extend `list.index`, returning the current index if `value`
is `None`.