Commit a561f0f1 authored by Aurel's avatar Aurel Committed by Kazuhiko Shiozaki

clean-up import, whitespace, not used variables

parent 38f2d50a
...@@ -33,8 +33,7 @@ from AccessControl import ClassSecurityInfo ...@@ -33,8 +33,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5.Document.Image import Image from Products.ERP5.Document.Image import Image
from Products.ERP5.Document.Document import ConversionError,\ from Products.ERP5.Document.Document import ConversionError
VALID_TEXT_FORMAT_LIST
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from zLOG import LOG, INFO, PROBLEM from zLOG import LOG, INFO, PROBLEM
import errno import errno
...@@ -82,7 +81,7 @@ class PDFDocument(Image): ...@@ -82,7 +81,7 @@ class PDFDocument(Image):
* Watermark is applied at all pages starting watermark_start_page (this * Watermark is applied at all pages starting watermark_start_page (this
index is 0 based) index is 0 based)
""" """
from pyPdf import PdfFileWriter, PdfFileReader, pdf from pyPdf import PdfFileWriter, PdfFileReader
if not watermark_data: if not watermark_data:
raise ValueError("watermark_data cannot not be empty") raise ValueError("watermark_data cannot not be empty")
if not self.hasData(): if not self.hasData():
...@@ -177,8 +176,8 @@ class PDFDocument(Image): ...@@ -177,8 +176,8 @@ class PDFDocument(Image):
else: else:
# Try to use OCR # Try to use OCR
# As high dpi images are required, it may take some times to convert the # As high dpi images are required, it may take some times to convert the
# pdf. # pdf.
# It may be required to use activities to fill the cache and at the end, # It may be required to use activities to fill the cache and at the end,
# to calculate the final result # to calculate the final result
text = '' text = ''
content_information = self.getContentInformation() content_information = self.getContentInformation()
...@@ -320,7 +319,7 @@ class PDFDocument(Image): ...@@ -320,7 +319,7 @@ class PDFDocument(Image):
# Ignore values that cannot be pickled ( such as AAPL:Keywords ) # Ignore values that cannot be pickled ( such as AAPL:Keywords )
try: try:
pickle.dumps(info_value) pickle.dumps(info_value)
except pickle.PicklingError, err: except pickle.PicklingError:
LOG("PDFDocument.getContentInformation", INFO, LOG("PDFDocument.getContentInformation", INFO,
"Ignoring non picklable document info on %s: %s (%r)" % ( "Ignoring non picklable document info on %s: %s (%r)" % (
self.getRelativeUrl(), info_key, info_value)) self.getRelativeUrl(), info_key, info_value))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment