Fix #245
parent
5330620ea2
commit
6c4b468800
|
|
@ -33,13 +33,14 @@ class PDFHandler(object):
|
||||||
self.filepath = filepath
|
self.filepath = filepath
|
||||||
if not filepath.lower().endswith('.pdf'):
|
if not filepath.lower().endswith('.pdf'):
|
||||||
raise NotImplementedError("File format not supported")
|
raise NotImplementedError("File format not supported")
|
||||||
self.pages = self._get_pages(self.filepath, pages)
|
|
||||||
if password is None:
|
if password is None:
|
||||||
self.password = ''
|
self.password = ''
|
||||||
else:
|
else:
|
||||||
self.password = password
|
self.password = password
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
self.password = self.password.encode('ascii')
|
self.password = self.password.encode('ascii')
|
||||||
|
self.pages = self._get_pages(self.filepath, pages)
|
||||||
|
|
||||||
def _get_pages(self, filepath, pages):
|
def _get_pages(self, filepath, pages):
|
||||||
"""Converts pages string to list of ints.
|
"""Converts pages string to list of ints.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue