home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- from __future__ import with_statement
- __license__ = 'GPL v3'
- __copyright__ = '2009, John Schember <john@nachtimwald.com>'
- __docformat__ = 'restructuredtext en'
- import os
- from pyPdf import PdfFileReader
-
- def is_valid_pdf(pdf_path):
-
- try:
-
- try:
- pdf_file = _[1]
- PdfFileReader(pdf_file)
- finally:
- pass
-
- except:
- return False
-
- return True
-
-
- def is_valid_pdfs(pdf_paths):
- invalid = []
- for pdf_path in pdf_paths:
- if not is_valid_pdf(pdf_path):
- invalid.append(pdf_path)
- continue
-
- return invalid
-
-
- def is_encrypted(pdf_path):
-
- try:
- pdf_file = _[1]
- pdf = PdfFileReader(pdf_file)
- if pdf.isEncrypted:
- return True
- finally:
- pass
-
- return False
-
-