projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd2d82a
)
Add __len__ to PagedLists
author
Philipp Hagemeister
<phihag@phihag.de>
Wed, 22 Jan 2014 20:43:33 +0000
(21:43 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Wed, 22 Jan 2014 20:43:33 +0000
(21:43 +0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index ed5ee222f5ccdf75563681266777c8e9c132df80..8fa4cb67f3c0fd8344ad33e1bc3098d2653cc085 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1172,6
+1172,10
@@
class PagedList(object):
self._pagefunc = pagefunc
self._pagesize = pagesize
+ def __len__(self):
+ # This is only useful for tests
+ return len(self.getslice())
+
def getslice(self, start=0, end=None):
res = []
for pagenum in itertools.count(start // self._pagesize):