From: W. Trevor King Date: Tue, 3 Aug 2010 16:57:34 +0000 (-0400) Subject: Use .index() instead of ._index for NoteIndexList access X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ddecab05be03e4d7ccaeb80bb18c976c026deb1c;p=hooke.git Use .index() instead of ._index for NoteIndexList access --- diff --git a/hooke/plugin/playlist.py b/hooke/plugin/playlist.py index 82d0c83..73fd5a3 100644 --- a/hooke/plugin/playlist.py +++ b/hooke/plugin/playlist.py @@ -133,7 +133,7 @@ class IndexCommand (Command): help=self.__doc__, plugin=plugin) def _run(self, hooke, inqueue, outqueue, params): - outqueue.put(params['playlist']._index) + outqueue.put(params['playlist'].index()) class GetCommand (Command): """Return a :class:`hooke.playlist.Playlist`. @@ -269,7 +269,7 @@ Index of target curve. def _run(self, hooke, inqueue, outqueue, params): params['playlist'].pop(params['index']) - params['playlist'].jump(params._index) + params['playlist'].jump(params.index()) class FilterCommand (Command): """Create a subset playlist via a selection function. diff --git a/hooke/plugin/playlists.py b/hooke/plugin/playlists.py index 2be0c9b..44bbe92 100644 --- a/hooke/plugin/playlists.py +++ b/hooke/plugin/playlists.py @@ -84,7 +84,7 @@ class IndexCommand (Command): help=self.__doc__, plugin=plugin) def _run(self, hooke, inqueue, outqueue, params): - outqueue.put(hooke.playlists._index) + outqueue.put(hooke.playlists.index()) class PlaylistListCommand (Command): """Get the playlists in `hooke.playlists`. diff --git a/hooke/ui/__init__.py b/hooke/ui/__init__.py index ad09e02..d70bd41 100644 --- a/hooke/ui/__init__.py +++ b/hooke/ui/__init__.py @@ -103,7 +103,7 @@ Hooke version %s def _playlist_status(self, playlist): if len(playlist) > 0: - return '%s (%s/%s)' % (playlist.name, playlist._index + 1, + return '%s (%s/%s)' % (playlist.name, playlist.index() + 1, len(playlist)) return 'The playlist %s does not contain any valid force curve data.' \ % self.name diff --git a/hooke/ui/gui/panel/playlist.py b/hooke/ui/gui/panel/playlist.py index ddfedb1..c50da0b 100644 --- a/hooke/ui/gui/panel/playlist.py +++ b/hooke/ui/gui/panel/playlist.py @@ -331,7 +331,7 @@ class Tree (wx.TreeCtrl): self.Bind(wx.EVT_TREE_SEL_CHANGED, self._on_select) def update_playlist(self, playlist): - """Absorb changed `._index`, etc. + """Absorb changed `.index()`, etc. """ self._playlists[playlist.name] = playlist diff --git a/hooke/ui/gui/statusbar.py b/hooke/ui/gui/statusbar.py index 758a412..dcd1ac3 100644 --- a/hooke/ui/gui/statusbar.py +++ b/hooke/ui/gui/statusbar.py @@ -40,7 +40,7 @@ class StatusBar (wx.StatusBar): def _playlist_status(self, playlist): fields = [ playlist.name, - '(%d/%d)' % (playlist._index, len(playlist)), + '(%d/%d)' % (playlist.index(), len(playlist)), ] curve = playlist.current() if curve != None: