Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
a561f0f1
Commit
a561f0f1
authored
Oct 09, 2013
by
Aurel
Committed by
Kazuhiko Shiozaki
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean-up import, whitespace, not used variables
parent
38f2d50a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
product/ERP5/Document/PDFDocument.py
product/ERP5/Document/PDFDocument.py
+5
-6
No files found.
product/ERP5/Document/PDFDocument.py
View file @
a561f0f1
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment