From 4b2beba398f51b631c445a0c720f09fa0fe69d00 Mon Sep 17 00:00:00 2001 From: Yusuke Shinyama Date: Mon, 24 Mar 2014 20:59:24 +0900 Subject: [PATCH] Code cleanup. --- pdfminer/pdfdocument.py | 7 +++---- pdfminer/pdfinterp.py | 1 - pdfminer/pdfpage.py | 4 +--- pdfminer/pdftypes.py | 5 ----- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pdfminer/pdfdocument.py b/pdfminer/pdfdocument.py index c170f1a..d638876 100644 --- a/pdfminer/pdfdocument.py +++ b/pdfminer/pdfdocument.py @@ -26,22 +26,21 @@ from utils import decode_text class PDFNoValidXRef(PDFSyntaxError): pass - class PDFNoOutlines(PDFException): pass - class PDFDestinationNotFound(PDFException): pass - class PDFEncryptionError(PDFException): pass - class PDFPasswordIncorrect(PDFEncryptionError): pass +class PDFTextExtractionNotAllowed(PDFEncryptionError): + pass + # some predefined literals and keywords. LITERAL_OBJSTM = LIT('ObjStm') LITERAL_XREF = LIT('XRef') diff --git a/pdfminer/pdfinterp.py b/pdfminer/pdfinterp.py index 2eda0ae..4b7a6b0 100644 --- a/pdfminer/pdfinterp.py +++ b/pdfminer/pdfinterp.py @@ -29,7 +29,6 @@ from utils import mult_matrix, MATRIX_IDENTITY class PDFResourceError(PDFException): pass - class PDFInterpreterError(PDFException): pass diff --git a/pdfminer/pdfpage.py b/pdfminer/pdfpage.py index 95d12f3..154bbc3 100644 --- a/pdfminer/pdfpage.py +++ b/pdfminer/pdfpage.py @@ -7,15 +7,13 @@ from pdftypes import int_value, list_value, dict_value from pdfparser import PDFParser from pdfdocument import PDFDocument from pdfdocument import PDFEncryptionError +from pdfdocument import PDFTextExtractionNotAllowed # some predefined literals and keywords. LITERAL_PAGE = LIT('Page') LITERAL_PAGES = LIT('Pages') -class PDFTextExtractionNotAllowed(PDFEncryptionError): - pass - ## PDFPage ## class PDFPage(object): diff --git a/pdfminer/pdftypes.py b/pdfminer/pdftypes.py index 0c70bc9..0131382 100644 --- a/pdfminer/pdftypes.py +++ b/pdfminer/pdftypes.py @@ -25,23 +25,18 @@ LITERALS_DCT_DECODE = (LIT('DCTDecode'), LIT('DCT')) class PDFObject(PSObject): pass - class PDFException(PSException): pass - class PDFTypeError(PDFException): pass - class PDFValueError(PDFException): pass - class PDFObjectNotFound(PDFException): pass - class PDFNotImplementedError(PDFException): pass