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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
erp5
Commits
0b0b2126
Commit
0b0b2126
authored
Mar 10, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dms: fix pylint messages and enable coding style test
parent
bd601780
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
224 additions
and
106 deletions
+224
-106
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.py
...mplateItem/portal_components/document.erp5.PDFDocument.py
+4
-4
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.xml
...plateItem/portal_components/document.erp5.PDFDocument.xml
+25
-8
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.py
...em/portal_components/extension.erp5.DocumentManagement.py
+4
-4
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.xml
...m/portal_components/extension.erp5.DocumentManagement.xml
+62
-19
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentSecurity.py
...Item/portal_components/extension.erp5.DocumentSecurity.py
+1
-1
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentSecurity.xml
...tem/portal_components/extension.erp5.DocumentSecurity.xml
+62
-19
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.py
...Item/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.py
...m/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.py
+1
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getBaseCategoryList.py
...tem/portal_skins/erp5_dms/Document_getBaseCategoryList.py
+2
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getFailsafeConversion.py
...m/portal_skins/erp5_dms/Document_getFailsafeConversion.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.py
.../portal_skins/erp5_dms/Document_getRelatedDocumentList.py
+1
-3
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashBaseCategoryList.py
...em/portal_skins/erp5_dms/Document_hashBaseCategoryList.py
+2
-3
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashFunctionItemList.py
...em/portal_skins/erp5_dms/Document_hashFunctionItemList.py
+3
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashFunctionItemList.xml
...m/portal_skins/erp5_dms/Document_hashFunctionItemList.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashGroupItemList.py
...eItem/portal_skins/erp5_dms/Document_hashGroupItemList.py
+3
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashGroupItemList.xml
...Item/portal_skins/erp5_dms/Document_hashGroupItemList.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashSiteItemList.py
...teItem/portal_skins/erp5_dms/Document_hashSiteItemList.py
+3
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashSiteItemList.xml
...eItem/portal_skins/erp5_dms/Document_hashSiteItemList.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
...ortal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
+0
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
...portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
+0
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.py
...TemplateItem/portal_skins/erp5_dms/Document_uploadFile.py
+3
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.py
...5_dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.xml
..._dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml
...p5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.py
...s/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml
.../erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestinationAssignment.py
.../ERP5Type_getSecurityCategoryFromDestinationAssignment.py
+2
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestinationAssignment.xml
...ERP5Type_getSecurityCategoryFromDestinationAssignment.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromObjectAssignment.py
...5_dms/ERP5Type_getSecurityCategoryFromObjectAssignment.py
+2
-4
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromObjectAssignment.xml
..._dms/ERP5Type_getSecurityCategoryFromObjectAssignment.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromUser.xml
...l_skins/erp5_dms/ERP5Type_getSecurityCategoryFromUser.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.py
...portal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.xml
...ortal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.xml
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/FCKeditor_getSetReferenceUrl.py
...tem/portal_skins/erp5_dms/FCKeditor_getSetReferenceUrl.py
+8
-2
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Image_checkConversionFormatPermission.py
...l_skins/erp5_dms/Image_checkConversionFormatPermission.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Image_convert.py
...s/SkinTemplateItem/portal_skins/erp5_dms/Image_convert.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_convert.py
...TemplateItem/portal_skins/erp5_dms/OOoDocument_convert.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
...tal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_getPageNumberFromSelectionIndex.py
...tal_skins/erp5_dms/PDF_getPageNumberFromSelectionIndex.py
+5
-5
bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_ingestion_workflow/scripts/Event_replyMailMessage.py
...ment_ingestion_workflow/scripts/Event_replyMailMessage.py
+6
-4
bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml
.../document_publication_workflow/scripts/archiveVersion.xml
+1
-1
bt5/erp5_dms/bt/skip_coding_style_test
bt5/erp5_dms/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.py
View file @
0b0b2126
...
...
@@ -115,7 +115,7 @@ class PDFDocument(Image):
return
outputStream
.
getvalue
()
# Conversion API
def
_convert
(
self
,
format
,
**
kw
):
def
_convert
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""
Implementation of conversion for PDF files
"""
...
...
@@ -164,7 +164,7 @@ class PDFDocument(Image):
raise
NotImplementedError
security
.
declarePrivate
(
'_convertToText'
)
def
_convertToText
(
self
):
def
_convertToText
(
self
,
format
=
'txt'
):
# pylint: disable=redefined-builtin
"""
Convert the PDF text content to text with pdftotext
"""
...
...
@@ -346,9 +346,9 @@ class PDFDocument(Image):
self
.
_content_information
=
result
return
result
.
copy
()
def
_setFile
(
self
,
data
,
precondition
=
None
):
def
_setFile
(
self
,
*
args
,
**
kw
):
try
:
del
self
.
_content_information
except
(
AttributeError
,
KeyError
):
pass
Image
.
_setFile
(
self
,
data
,
precondition
=
precondition
)
Image
.
_setFile
(
self
,
*
args
,
**
kw
)
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.xml
View file @
0b0b2126
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
PDFDocument
</string>
</value>
...
...
@@ -43,11 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:117, 21: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:166, 2: Arguments number differs from overridden \'_convertToText\' method (arguments-differ)
</string>
<string>
W:348, 2: Arguments number differs from overridden \'_setFile\' method (arguments-differ)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -57,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -76,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -85,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.py
View file @
0b0b2126
...
...
@@ -71,7 +71,7 @@ def mkProxy(self):
sp
=
xmlrpclib
.
ServerProxy
(
'http://%s:%d'
%
(
adr
,
nr
),
allow_none
=
True
)
return
sp
def
generateFile
(
self
,
name
,
data
,
format
):
def
generateFile
(
self
,
name
,
data
,
format
):
# pylint: disable=redefined-builtin
sp
=
mkProxy
(
self
)
kw
=
sp
.
run_generate
(
name
,
data
,
None
,
format
)
res
=
base64
.
decodestring
(
kw
[
'data'
])
...
...
@@ -92,7 +92,7 @@ def getLastWorkflowDate(self, state_name='simulation_state', state=('released','
or JP says "there is an API for it" and we trash this one'''
if
not
hasattr
(
self
,
'workflow_history'
):
return
None
for
name
,
wflow
in
self
.
workflow_history
.
item
s
():
for
wflow
in
self
.
workflow_history
.
value
s
():
if
wflow
is
None
or
len
(
wflow
)
==
0
:
continue
# empty history
if
wflow
[
0
].
get
(
state_name
)
is
None
:
continue
# not the right one
for
i
in
range
(
len
(
wflow
)):
...
...
@@ -110,7 +110,7 @@ def findAddress(txt):
"""
find email address in a string
"""
validchars
=
'0-9A-Za-z.
\
-_
'
validchars
=
r
'0-9A-Za-z.\
-_
'
r=re.compile('
[
%
s
]
+@
[
%
s
]
+
' % (validchars,validchars))
m=r.search(txt)
return m and m.group()
...
...
@@ -121,7 +121,7 @@ def extractParams(txt):
We assume that parameters are given as lines of the format:
name:value
"""
r
=re.compile(
'
^
([
\
w_
]
+
):([
\
w_
/
]
+
)
$
')
r
= re.compile(r
'
^
([
\
w_
]
+
):([
\
w_
/
]
+
)
$
')
res=[]
for line in txt.split():
found=r.findall(line.strip())
...
...
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.xml
View file @
0b0b2126
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DocumentManagement
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.DocumentManagement
</string>
</value>
...
...
@@ -24,6 +36,18 @@
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
...
...
@@ -31,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -50,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -59,26 +98,30 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentSecurity.py
View file @
0b0b2126
...
...
@@ -26,7 +26,7 @@
##############################################################################
def
getPersonRoleList
(
self
,
person
,
object
):
def
getPersonRoleList
(
self
,
person
,
object
):
# pylint: disable=redefined-builtin
"""
Get list of local roles for user.
"""
...
...
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentSecurity.xml
View file @
0b0b2126
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DocumentSecurity
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.DocumentSecurity
</string>
</value>
...
...
@@ -24,6 +36,18 @@
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
...
...
@@ -31,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -50,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -59,26 +98,30 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.py
View file @
0b0b2126
...
...
@@ -27,7 +27,7 @@ for frequency_reference, creation_date in date_dict.items():
max_in_activities
=
1000
offset
=
0
loop
=
documents_to_update
/
max_in_activities
for
i
in
range
(
loop
):
for
_
in
range
(
loop
):
limit
=
'%s,%s'
%
(
offset
,
max_in_activities
)
sql_kw
[
'limit'
]
=
limit
updateDocumentList
(
**
sql_kw
)
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.py
View file @
0b0b2126
...
...
@@ -6,5 +6,4 @@ if I don't have permissions to access the object)
object_list
=
context
.
Base_getRelatedObjectValueList
(
base_category
,
portal_type_list
)
title_list
=
[
o
.
getTitle
()
for
o
in
object_list
]
return
filter
(
lambda
t
:
t
!=
''
,
title_list
)
return
[
t
for
t
in
title_list
if
t
!=
''
]
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getBaseCategoryList.py
View file @
0b0b2126
...
...
@@ -10,8 +10,8 @@ nr_of_types = len(type_list)
basecatdict
=
{}
for
type
in
type_list
:
type_base_cat_list
=
context
.
portal_types
[
type
].
getInstanceBaseCategoryList
()
for
type
_info
in
type_list
:
type_base_cat_list
=
context
.
portal_types
[
type
_info
].
getInstanceBaseCategoryList
()
for
base_cat
in
type_base_cat_list
:
basecatdict
[
base_cat
]
=
basecatdict
.
setdefault
(
base_cat
,
0
)
+
1
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getFailsafeConversion.py
View file @
0b0b2126
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""
Generic method to handle conversion failures ans still return something to use
to explain what when wrong, etc.
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getRelatedDocumentList.py
View file @
0b0b2126
...
...
@@ -12,8 +12,7 @@ version of each of them.
# Document_getSimilarityCloud = Document_get + upperCase(cloud) + ValueList
# BG - not much use, they're too different
from
Products.ERP5Type.Utils
import
convertToUpperCase
,
convertToMixedCase
from
Products.ERP5Type.Log
import
log
from
Products.ERP5Type.Utils
import
convertToUpperCase
def
getRelatedLatest
(
category
):
funcname
=
'get%sValueList'
%
convertToUpperCase
(
category
)
...
...
@@ -44,5 +43,4 @@ if relation_id == 'all':
dic
[
obj
]
=
None
return
dic
.
keys
()
log
(
'Relation %s is not provided for in this script'
%
relation
)
return
[]
# failover - undefined relation
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashBaseCategoryList.py
View file @
0b0b2126
...
...
@@ -8,8 +8,8 @@
from
Products.ERP5Type.Cache
import
CachingMethod
def
cached_DMSGetItemList
(
base_category
):
basecatobject
=
context
.
portal_categories
.
resolveCategory
(
base_category
)
return
basecatobject
.
getCategoryChildLogicalPathItemList
()
basecatobject
=
context
.
portal_categories
.
resolveCategory
(
base_category
)
return
basecatobject
.
getCategoryChildLogicalPathItemList
()
cached_DMSGetItemList
=
CachingMethod
(
cached_DMSGetItemList
,
id
=
'DMGetItemListCachedMethodWhatever'
)
...
...
@@ -26,7 +26,6 @@ if default_sub_field_property_dict is None:
}
sub_field_dict
=
{}
maximum_list_size
=
5
default_sub_field_property_dict
[
'field_type'
]
=
'ListField'
default_sub_field_property_dict
[
'size'
]
=
1
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashFunctionItemList.py
View file @
0b0b2126
...
...
@@ -3,6 +3,8 @@
in such way that it is possible to select multiple
group categories for the same document
"""
if
default_sub_field_property_dict
is
None
:
default_sub_field_property_dict
=
{}
# Initialise result
sub_field_list
=
[]
...
...
@@ -16,7 +18,7 @@ default_sub_field_property_dict.update({
})
z
=
0
for
i
in
range
(
1
):
for
_
in
range
(
1
):
new_dict
=
default_sub_field_property_dict
.
copy
()
new_dict
[
'title'
]
=
' '
new_dict
[
'key'
]
=
str
(
z
)
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashFunctionItemList.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
{}
, is_right_display=0
</string>
</value>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
None
, is_right_display=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashGroupItemList.py
View file @
0b0b2126
...
...
@@ -3,6 +3,8 @@
in such way that it is possible to select multiple
function categories for the same document
"""
if
default_sub_field_property_dict
is
None
:
default_sub_field_property_dict
=
{}
# Initialise result
sub_field_list
=
[]
...
...
@@ -16,7 +18,7 @@ default_sub_field_property_dict.update({
})
z
=
0
for
i
in
range
(
1
):
for
_
in
range
(
1
):
new_dict
=
default_sub_field_property_dict
.
copy
()
new_dict
[
'title'
]
=
' '
new_dict
[
'key'
]
=
str
(
z
)
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashGroupItemList.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
{}
, is_right_display=0
</string>
</value>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
None
, is_right_display=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashSiteItemList.py
View file @
0b0b2126
...
...
@@ -3,6 +3,8 @@
in such way that it is possible to select multiple
site categories for the same document
"""
if
default_sub_field_property_dict
is
None
:
default_sub_field_property_dict
=
{}
# Initialise result
sub_field_list
=
[]
...
...
@@ -16,7 +18,7 @@ default_sub_field_property_dict.update({
})
z
=
0
for
i
in
range
(
1
):
for
_
in
range
(
1
):
new_dict
=
default_sub_field_property_dict
.
copy
()
new_dict
[
'title'
]
=
' '
new_dict
[
'key'
]
=
str
(
z
)
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_hashSiteItemList.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
{}
, is_right_display=0
</string>
</value>
<value>
<string>
item_list, value_list, default_sub_field_property_dict=
None
, is_right_display=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
View file @
0b0b2126
...
...
@@ -19,8 +19,6 @@ if context.getExternalProcessingState() not in ('converted', 'empty'):
message
=
'Socket Error: %s'
%
(
repr
(
e
)
or
'undefined.'
)
except
Exception
,
e
:
message
=
'Problem: %s'
%
(
repr
(
e
)
or
'undefined.'
)
except
:
message
=
'Problem: unknown'
# reach here, then exception was raised, message must be logged in workflow
# do not simply raise but rather change external processing state
# so user will see something is wrong
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
View file @
0b0b2126
...
...
@@ -11,8 +11,6 @@ except ConversionError, e:
message
=
'Conversion Error: %s'
%
(
str
(
e
)
or
'undefined.'
)
except
Exception
,
e
:
message
=
'Problem: %s'
%
(
repr
(
e
)
or
'undefined.'
)
except
:
message
=
'Problem: unknown'
# reach here, then exception was raised, message must be logged in workflow
# do not simply raise but rather change external processing state
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.py
View file @
0b0b2126
# this script has an `file` argument
# pylint: disable=redefined-builtin
"""
This script is called when a file is uploaded to an object via ERP5 standard interface.
It does the following:
...
...
@@ -9,9 +11,9 @@ Otherwise it just uploads the file, bumps up revision number and calls metadata
"""
from
Products.ERP5Type.Log
import
log
,
WARNING
from
Products.ERP5Type.Message
import
translateString
translate
=
context
.
Base_translateString
request
=
context
.
REQUEST
current_type
=
context
.
getPortalType
()
file_name
=
file
.
filename
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.py
View file @
0b0b2126
...
...
@@ -3,4 +3,4 @@
only the group the user is directly assigned to (not the whole group hierarchy path).
"""
return
context
.
ERP5Type_getSecurityCategoryFromAssignmentTree
(
base_category_list
,
user_name
,
obj
ect
,
portal_type
,
strict
=
True
)
return
context
.
ERP5Type_getSecurityCategoryFromAssignmentTree
(
base_category_list
,
user_name
,
obj
,
portal_type
,
strict
=
True
)
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentStrict.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type, strict=False, root=False
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type, strict=False, root=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.py
View file @
0b0b2126
...
...
@@ -5,7 +5,7 @@ of the document (e.g. in Memo type).
from
Products.ERP5Type.Log
import
log
category_list
=
[]
for
ob
in
obj
ect
.
getDestinationValueList
():
for
ob
in
obj
.
getDestinationValueList
():
category_dict
=
{}
for
base_category
in
base_category_list
:
if
base_category
==
'group'
:
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestination.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestinationAssignment.py
View file @
0b0b2126
...
...
@@ -6,7 +6,7 @@ is addressed to (destination). Can be multiple destination persons.
category_list
=
[]
# We look for valid assignments of destination users
for
person_object
in
obj
ect
.
getDestinationValueList
(
portal_type
=
'Person'
):
for
person_object
in
obj
.
getDestinationValueList
(
portal_type
=
'Person'
):
for
assignment
in
person_object
.
contentValues
(
filter
=
{
'portal_type'
:
'Assignment'
}):
if
assignment
.
getValidationState
()
==
'open'
:
category_dict
=
{}
...
...
@@ -18,7 +18,7 @@ for person_object in object.getDestinationValueList(portal_type='Person'):
if
category_value
not
in
(
None
,
''
):
category_dict
[
base_category
]
=
category_value
else
:
raise
RuntimeError
,
"Error: '%s' property is required in order to update person security group"
%
(
base_category
)
raise
RuntimeError
(
"Error: '%s' property is required in order to update person security group"
%
(
base_category
)
)
category_list
.
append
(
category_dict
)
return
category_list
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromDestinationAssignment.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromObjectAssignment.py
View file @
0b0b2126
...
...
@@ -8,10 +8,8 @@ Person, just take from the object.
category_list
=
[]
person_object
=
object
# We look for valid assignments of this user
for
assignment
in
person_object
.
contentValues
(
filter
=
{
'portal_type'
:
'Assignment'
}):
for
assignment
in
obj
.
contentValues
(
filter
=
{
'portal_type'
:
'Assignment'
}):
if
assignment
.
getValidationState
()
==
'open'
:
category_dict
=
{}
for
base_category
in
base_category_list
:
...
...
@@ -22,7 +20,7 @@ for assignment in person_object.contentValues(filter={'portal_type': 'Assignment
if
category_value
not
in
(
None
,
''
):
category_dict
[
base_category
]
=
category_value
else
:
raise
RuntimeError
,
"Error: '%s' property is required in order to update person security group"
%
(
base_category
)
raise
RuntimeError
(
"Error: '%s' property is required in order to update person security group"
%
(
base_category
)
)
category_list
.
append
(
category_dict
)
return
category_list
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromObjectAssignment.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromUser.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.py
View file @
0b0b2126
...
...
@@ -6,4 +6,4 @@ in the certain organisation - for this, all we need is the first part
of the group category.
"""
return
context
.
ERP5Type_getSecurityCategoryFromAssignmentTree
(
base_category_list
,
user_name
,
obj
ect
,
portal_type
,
strict
=
True
,
root
=
True
)
return
context
.
ERP5Type_getSecurityCategoryFromAssignmentTree
(
base_category_list
,
user_name
,
obj
,
portal_type
,
strict
=
True
,
root
=
True
)
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryRoot.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/FCKeditor_getSetReferenceUrl.py
View file @
0b0b2126
...
...
@@ -4,5 +4,11 @@ if brain.getValidationState() == 'embedded':
reference
=
brain
.
getId
()
else
:
reference
=
brain
.
getReference
()
format
=
context
.
getPortalObject
().
portal_preferences
.
getPreferredImageFormat
()
return
unicode
(
"javascript:SelectFile('%s?format=%s')"
%
(
reference
.
replace
(
"'"
,
"
\
\
'"
),
format
),
'utf-8'
)
return
unicode
(
"javascript:SelectFile('%s?format=%s')"
%
(
reference
.
replace
(
"'"
,
"
\
\
'"
),
context
.
getPortalObject
().
portal_preferences
.
getPreferredImageFormat
()
),
'utf-8'
,
)
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Image_checkConversionFormatPermission.py
View file @
0b0b2126
# this script has an `format` argument
# pylint: disable=redefined-builtin
if
format
in
(
'svg'
,):
image_pixels
=
context
.
getHeight
()
*
context
.
getWidth
()
max_pixels
=
128
*
128
# default thumbnail size
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Image_convert.py
View file @
0b0b2126
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""
Convert Image (context) to a desired format and return as a binary `filename` file.
Requires format and desired filename (adds extension if missing).
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_convert.py
View file @
0b0b2126
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""
Convert OOoDocument (context) to a desired format and return as a binary `filename` file.
Requires format and desired filename (adds extension if missing).
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
View file @
0b0b2126
# this script has an `format` argument
# pylint: disable=redefined-builtin
from
Products.ERP5.Document.Document
import
VALID_IMAGE_FORMAT_LIST
if
format
in
VALID_IMAGE_FORMAT_LIST
:
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_getPageNumberFromSelectionIndex.py
View file @
0b0b2126
content_information
=
context
.
getContentInformation
()
number_of_pages
=
int
(
content_information
.
get
(
'Pages'
,
1
))
max
=
number_of_pages
-
1
max
_
=
number_of_pages
-
1
selection_index
=
int
(
selection_index
)
if
selection_index
>
max
:
return
max
elif
-
max
>
selection_index
:
if
selection_index
>
max
_
:
return
max
_
elif
-
max
_
>
selection_index
:
return
0
elif
selection_index
<
0
:
return
max
+
selection_index
+
1
return
max
_
+
selection_index
+
1
else
:
return
selection_index
bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_ingestion_workflow/scripts/Event_replyMailMessage.py
View file @
0b0b2126
message
=
state_change
.
kwargs
[
'reply_body'
]
subject
=
state_change
.
kwargs
[
'reply_subject'
]
recipient
=
state_change
.
kwargs
[
'reply_to'
]
objec
t
=
state_change
[
'object'
]
even
t
=
state_change
[
'object'
]
state_change
[
'object'
].
MailHost
.
send
(
message
,
mto
=
recipient
,
mfrom
=
object
.
portal_preferences
.
getPreferredEventSenderEmail
(),
subject
=
subject
)
event
.
MailHost
.
send
(
message
,
mto
=
recipient
,
mfrom
=
event
.
portal_preferences
.
getPreferredEventSenderEmail
(),
subject
=
subject
)
bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml
View file @
0b0b2126
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change, validation_state=
[\'published\', \'published_alive\', \'released\', \'released_alive\', \'shared\', \'shared_alive\']
, now=None
</string>
</value>
<value>
<string>
state_change, validation_state=
(\'published\', \'published_alive\', \'released\', \'released_alive\', \'shared\', \'shared_alive\')
, now=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_dms/bt/skip_coding_style_test
deleted
100644 → 0
View file @
bd601780
1
\ No newline at end of file
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