Skip to content

Commit

Permalink
Add slice support to search result pager.
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerrp committed Apr 1, 2012
1 parent 2198d9e commit 86b54a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tmdb3/pager.py
Expand Up @@ -57,6 +57,8 @@ def __init__(self, iterable, pagesize=20):
self._pagesize = pagesize

def __getitem__(self, index):
if isinstance(index, slice):
return [self[x] for x in xrange(*index.indices(len(self)))]
if index >= len(self):
raise IndexError("list index outside range")
if (index >= len(self._data)) \
Expand Down
4 changes: 3 additions & 1 deletion tmdb3/tmdb_api.py
Expand Up @@ -22,7 +22,7 @@
Preliminary API specifications can be found at
http://help.themoviedb.org/kb/api/about-3"""

__version__="v0.4.4"
__version__="v0.4.6"
# 0.1.0 Initial development
# 0.2.0 Add caching mechanism for API queries
# 0.2.1 Temporary work around for broken search paging
Expand All @@ -39,6 +39,8 @@
# 0.4.2 Improve cache file selection for Windows systems
# 0.4.3 Add a few missed Person properties
# 0.4.4 Add support for additional Studio information
# 0.4.5 Add locale fallthrough for images and alternate titles
# 0.4.6 Add slice support for search results

from request import set_key, Request
from util import Datapoint, Datalist, Datadict, Element
Expand Down

0 comments on commit 86b54a1

Please sign in to comment.