Skip to content

Commit

Permalink
PageRange.[iter]choose() not needed with PdfFileMerger.
Browse files Browse the repository at this point in the history
  • Loading branch information
switham committed Jan 9, 2014
1 parent d158aa5 commit d4e6418
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions PyPDF2/pagerange.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class PageRange(object):
o to_slice() gives the equivalent slice.
o str() and repr() allow printing.
o indices(n) is like slice.indices(n).
o choose(list) and iterchoose(list) choose pages from a list.
"""

def __init__(self, arg):
Expand Down Expand Up @@ -118,20 +117,6 @@ def indices(self, n):
"""
return self._slice.indices(n)

def iterchoose(self, pages):
"""
pages must be a list (it must have a len()).
Return an iterator over the pages chosen by this page range.
"""
return (pages[i] for i in xrange(*self.indices(len(pages))))

def choose(self, pages):
"""
pages must be a list (it must have a len()).
Return a list of the pages chosen by this page range.
"""
return [self.iterchoose(pages)]


PAGE_RANGE_ALL = PageRange(":") # The range of all pages.

Expand Down

0 comments on commit d4e6418

Please sign in to comment.