Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
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
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5.Document.Image
import
Image
from
Products.ERP5.Document.Document
import
ConversionError
,
\
VALID_TEXT_FORMAT_LIST
from
Products.ERP5.Document.Document
import
ConversionError
from
subprocess
import
Popen
,
PIPE
from
zLOG
import
LOG
,
INFO
,
PROBLEM
import
errno
...
...
@@ -82,7 +81,7 @@ class PDFDocument(Image):
* Watermark is applied at all pages starting watermark_start_page (this
index is 0 based)
"""
from
pyPdf
import
PdfFileWriter
,
PdfFileReader
,
pdf
from
pyPdf
import
PdfFileWriter
,
PdfFileReader
if
not
watermark_data
:
raise
ValueError
(
"watermark_data cannot not be empty"
)
if
not
self
.
hasData
():
...
...
@@ -177,8 +176,8 @@ class PDFDocument(Image):
else
:
# Try to use OCR
# As high dpi images are required, it may take some times to convert the
# pdf.
# It may be required to use activities to fill the cache and at the end,
# pdf.
# It may be required to use activities to fill the cache and at the end,
# to calculate the final result
text
=
''
content_information
=
self
.
getContentInformation
()
...
...
@@ -320,7 +319,7 @@ class PDFDocument(Image):
# Ignore values that cannot be pickled ( such as AAPL:Keywords )
try
:
pickle
.
dumps
(
info_value
)
except
pickle
.
PicklingError
,
err
:
except
pickle
.
PicklingError
:
LOG
(
"PDFDocument.getContentInformation"
,
INFO
,
"Ignoring non picklable document info on %s: %s (%r)"
%
(
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