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
Lukas Niegsch
erp5
Commits
9f2fa835
Commit
9f2fa835
authored
May 28, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forge: fix pylint warnings and enable coding style test
parent
6f622d9b
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
146 additions
and
108 deletions
+146
-108
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.Glossary.py
...TemplateItem/portal_components/extension.erp5.Glossary.py
+6
-6
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.Glossary.xml
...emplateItem/portal_components/extension.erp5.Glossary.xml
+42
-3
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Subversion.py
...tTemplateItem/portal_components/module.erp5.Subversion.py
+1
-0
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.py
...ateItem/portal_components/module.erp5.SubversionClient.py
+5
-5
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.xml
...teItem/portal_components/module.erp5.SubversionClient.xml
+25
-10
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.WorkingCopy.py
...TemplateItem/portal_components/module.erp5.WorkingCopy.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_getRepositoryHistoryList.py
.../portal_skins/erp5_forge/Base_getRepositoryHistoryList.py
+0
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/BugLine_send.py
.../SkinTemplateItem/portal_skins/erp5_forge/BugLine_send.py
+2
-3
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Bug_newFile.py
...e/SkinTemplateItem/portal_skins/erp5_forge/Bug_newFile.py
+3
-0
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/CategoryTool_generateTranslationFile.py
..._skins/erp5_forge/CategoryTool_generateTranslationFile.py
+2
-7
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/TemplateTool_searchPortalType.py
.../portal_skins/erp5_forge/TemplateTool_searchPortalType.py
+1
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.py
...5_glossary/GlossaryModule_createTermListForTranslation.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPortalType.py
...ns/erp5_glossary/GlossaryModule_findTermFromPortalType.py
+2
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.py
...erp5_glossary/GlossaryModule_findTermFromPropertySheet.py
+2
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromWorkflow.py
...kins/erp5_glossary/GlossaryModule_findTermFromWorkflow.py
+4
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.py
...erp5_glossary/GlossaryModule_getBusinessFieldFieldList.py
+0
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldPortalTypeList.py
...glossary/GlossaryModule_getBusinessFieldPortalTypeList.py
+1
-4
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
...5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
+7
-8
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.py
...em/portal_skins/erp5_glossary/GlossaryModule_getPOFile.py
+6
-8
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.py
...ossary/GlossaryModule_getTermDictListFromPropertySheet.py
+5
-5
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_updatePortalTypeByTerm.py
...ns/erp5_glossary/GlossaryModule_updatePortalTypeByTerm.py
+0
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_getSimulationTree.py
...eItem/portal_skins/erp5_toolbox/Base_getSimulationTree.py
+2
-2
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
...Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
+12
-13
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_setSkinCache.py
...teItem/portal_skins/erp5_toolbox/ERP5Site_setSkinCache.py
+3
-3
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.py
...l_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnCheckout.py
...m/portal_skins/erp5_vcs/BusinessTemplate_doSvnCheckout.py
+0
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.py
...m/portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.py
+2
-0
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.xml
.../portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.xml
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogGlobal.py
.../portal_skins/erp5_vcs/BusinessTemplate_doVcsLogGlobal.py
+0
-3
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.py
...Item/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.py
+2
-0
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.xml
...tem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.xml
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_resolveConflicted.py
...rtal_skins/erp5_vcs/BusinessTemplate_resolveConflicted.py
+3
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/ERP5VCS_doCreateJavaScriptStatus.js.py
...tal_skins/erp5_vcs/ERP5VCS_doCreateJavaScriptStatus.js.py
+0
-5
bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_event_workflow/scripts/BugEvent_sendNotification.py
...w/bug_event_workflow/scripts/BugEvent_sendNotification.py
+3
-3
bt5/erp5_forge/bt/skip_coding_style_test
bt5/erp5_forge/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.Glossary.py
View file @
9f2fa835
...
...
@@ -49,7 +49,7 @@ def getActionTitleListFromAllActionProvider(portal):
for
provider
in
provider_list
:
for
action
in
provider
.
listActions
():
result
.
append
((
action
.
title
,
provider
.
getId
()))
result
.
append
((
action
.
title
,
provider
.
getId
()))
return
result
...
...
@@ -60,10 +60,10 @@ from zope.tal.talgenerator import TALGenerator
from
zope.tal.dummyengine
import
name_match
def
findStaticTranslationText
(
page_template
,
func_name_list
):
def
iterate
(
node
,
target_name
,
function
):
if
type
(
node
)
is
list
:
if
isinstance
(
node
,
list
)
:
for
i
in
node
:
iterate
(
i
,
target_name
,
function
)
elif
type
(
node
)
is
tuple
and
node
:
elif
isinstance
(
node
,
tuple
)
and
node
:
if
node
[
0
]
==
target_name
:
function
(
node
)
else
:
...
...
@@ -100,8 +100,8 @@ def findStaticTranslationText(page_template, func_name_list):
tal_expression
=
tal_expression
[
1
:
-
1
]
match
=
name_match
(
tal_expression
)
if
match
:
type
,
expression
=
match
.
group
(
1
,
2
)
if
type
==
'python'
:
type
_
,
expression
=
match
.
group
(
1
,
2
)
if
type
_
==
'python'
:
# clean up expression
expression
=
expression
.
strip
()
expression
=
expression
.
replace
(
'
\
n
'
,
' '
)
...
...
@@ -139,7 +139,7 @@ class MyDummyTALInterpreter(TALInterpreter):
_i18n_message_id_dict
=
None
_currentTag
=
None
def
translate
(
self
,
msgid
,
default
=
None
,
i18ndict
=
None
,
obj
=
None
):
def
translate
(
self
,
msgid
,
default
=
None
,
i18ndict
=
None
,
obj
=
None
):
# pylint:disable=arguments-differ
try
:
self
.
_i18n_message_id_dict
[
msgid
]
=
None
except
TypeError
:
...
...
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.Glossary.xml
View file @
9f2fa835
...
...
@@ -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>
Glossary
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.Glossary
</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,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Subversion.py
View file @
9f2fa835
# -*- coding: utf-8 -*-
# pylint: disable-all
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.py
View file @
9f2fa835
...
...
@@ -80,7 +80,7 @@ class SubversionLoginError(SubversionError):
"""
# Declarative Security
security
=
ClassSecurityInfo
()
def
__init__
(
self
,
realm
=
None
):
def
__init__
(
self
,
realm
=
None
):
# pylint:disable=super-init-not-called
self
.
_realm
=
realm
security
.
declarePublic
(
'getRealm'
)
...
...
@@ -96,7 +96,7 @@ class SubversionSSLTrustError(SubversionError):
# Declarative Security
security
=
ClassSecurityInfo
()
def
__init__
(
self
,
trust_dict
=
None
):
def
__init__
(
self
,
trust_dict
=
None
):
# pylint:disable=super-init-not-called
self
.
_trust_dict
=
trust_dict
security
.
declarePublic
(
'getTrustDict'
)
...
...
@@ -134,7 +134,7 @@ try:
return
False
,
''
class
GetLoginCallback
(
Callback
):
def
__call__
(
self
,
realm
,
username
,
may_save
):
def
__call__
(
self
,
realm
,
username
,
may_save
):
# pylint:disable=arguments-differ
user
,
password
=
self
.
client
.
getLogin
(
realm
)
if
not
username
or
not
password
:
self
.
client
.
setException
(
SubversionLoginError
(
realm
))
...
...
@@ -147,12 +147,12 @@ try:
return
True
,
user
,
password
,
False
class
NotifyCallback
(
Callback
):
def
__call__
(
self
,
event_dict
):
def
__call__
(
self
,
event_dict
):
# pylint:disable=arguments-differ
# FIXME: should accumulate information for the user
pass
class
SSLServerTrustPromptCallback
(
Callback
):
def
__call__
(
self
,
trust_dict
):
def
__call__
(
self
,
trust_dict
):
# pylint:disable=arguments-differ
if
not
self
.
client
.
trustSSLServer
(
trust_dict
):
self
.
client
.
setException
(
SubversionSSLTrustError
(
trust_dict
))
return
False
,
0
,
False
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.xml
View file @
9f2fa835
...
...
@@ -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>
SubversionClient
</string>
</value>
...
...
@@ -43,13 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 83, 2: __init__ method from base class \'SubversionError\' is not called (super-init-not-called)
</string>
<string>
W: 99, 2: __init__ method from base class \'SubversionError\' is not called (super-init-not-called)
</string>
<string>
W:137, 4: Arguments number differs from overridden \'__call__\' method (arguments-differ)
</string>
<string>
W:150, 4: Arguments number differs from overridden \'__call__\' method (arguments-differ)
</string>
<string>
W:155, 4: Arguments number differs from overridden \'__call__\' method (arguments-differ)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -59,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>
...
...
@@ -78,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>
...
...
@@ -87,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_forge/ModuleComponentTemplateItem/portal_components/module.erp5.WorkingCopy.py
View file @
9f2fa835
...
...
@@ -36,7 +36,7 @@ from AccessControl import Unauthorized
from
AccessControl.SecurityManagement
import
getSecurityManager
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
Acquisition
import
aq_base
,
Implicit
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
# pylint:disable=no-name-in-module,import-error
from
DateTime
import
DateTime
from
ZTUtils
import
make_query
from
Products.ERP5.Document.BusinessTemplate
import
BusinessTemplateFolder
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Base_getRepositoryHistoryList.py
View file @
9f2fa835
from
erp5.component.module.SubversionClient
import
SubversionSSLTrustError
from
Products.ERP5Type.Document
import
newTempBase
portal
=
context
.
getPortalObject
()
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/BugLine_send.py
View file @
9f2fa835
...
...
@@ -18,10 +18,10 @@ if from_url is None:
user
=
context
.
portal_membership
.
getAuthenticatedMember
().
getUserName
()
from_url
=
'"%s" <%s>'
%
(
user
,
context
.
email_from_address
)
# Return-Path
# Return-Path
. TODO: this is not implemented
if
reply_url
is
None
:
reply_url
=
context
.
portal_preferences
.
getPreferredEventSenderEmail
()
additional_headers
=
None
additional_headers
=
None
# pylint: disable=unused-variable
if
reply_url
:
additional_headers
=
{
'Return-Path'
:
reply_url
}
...
...
@@ -44,7 +44,6 @@ elif same_type(to_url, ''):
# Attachments
if
attachment_list
is
None
:
attachment_list
=
[]
document_type_list
=
context
.
getPortalDocumentTypeList
()
for
attachment
in
context
.
getAggregateValueList
():
mime_type
,
content
=
attachment
.
getMimeTypeAndContent
()
name
=
attachment
.
getReference
()
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/Bug_newFile.py
View file @
9f2fa835
...
...
@@ -2,6 +2,9 @@
This script creates a new event with given metadata and
attaches it to the current ticket.
"""
# pylint:disable=redefined-builtin
# this script uses file= argument
translateString
=
context
.
Base_translateString
default_bug_line
=
getattr
(
context
,
"default_bug_line"
,
None
)
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/CategoryTool_generateTranslationFile.py
View file @
9f2fa835
"""Return a po file from a spreadsheet of categories."""
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Document
import
newTempBase
# Initialise some general variables
detailed_report_result
=
[]
detailed_report_append
=
detailed_report_result
.
append
category_dict
=
{}
translation_dict
=
{}
translated_attributes_list
=
[
"title"
,
"description"
,
"short_title"
]
import_filename
=
getattr
(
import_file
,
'filename'
,
'?'
)
...
...
@@ -31,14 +29,11 @@ def invalid_category_spreadsheet_handler(message):
category_list_mapping
=
context
.
Base_getCategoriesSpreadSheetMapping
(
import_file
,
invalid_spreadsheet_error_handler
=
invalid_category_spreadsheet_handler
)
if
category_list_mapping
.
has_key
(
'error_list'
):
context
.
REQUEST
.
other
[
'category_import_report'
]
=
initial_category_list_mapping
[
'error_list'
]
return
context
.
CategoryTool_viewImportReport
()
assert
'error_list'
not
in
category_list_mapping
#Process on each category
for
base_category
,
category_list
in
category_list_mapping
.
item
s
():
for
category_list
in
category_list_mapping
.
value
s
():
for
category
in
category_list
:
#Take only needed attributes
for
attribute
in
translated_attributes_list
:
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/TemplateTool_searchPortalType.py
View file @
9f2fa835
...
...
@@ -6,8 +6,7 @@ for o in template_tool.contentValues(portal_type='Business Template'):
if
portal_type
in
o
.
getTemplatePortalTypeIdList
():
matching
.
append
(
o
.
getUid
())
else
:
allowed_content_type_list
=
o
.
getTemplatePortalTypeAllowedContentTypeList
()
allowed_content_type_list
=
map
(
lambda
x
:
x
and
x
.
split
(
'|'
)[
1
].
strip
(),
allowed_content_type_list
)
allowed_content_type_list
=
[
x
for
x
in
o
.
getTemplatePortalTypeAllowedContentTypeList
()
if
x
and
x
.
split
(
'|'
)[
1
].
strip
()]
if
portal_type
in
allowed_content_type_list
:
matching
.
append
(
o
.
getUid
())
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.py
View file @
9f2fa835
...
...
@@ -17,7 +17,7 @@ for i in catalog(portal_type='Glossary Term',
language_id
=
language
)
is
not
None
:
continue
new_term
=
glossary_module
.
newContent
(
portal_type
=
'Glossary Term'
,
glossary_module
.
newContent
(
portal_type
=
'Glossary Term'
,
reference
=
reference
,
business_field
=
business_field
,
language
=
language
,
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPortalType.py
View file @
9f2fa835
...
...
@@ -2,10 +2,10 @@ result = context.GlossaryModule_getTermDictListFromPortalType(portal_type_list)
if
export_tsv
:
for
i
in
result
:
print
'
\
t
'
.
join
(
map
(
lambda
x
:
'"%s"'
%
x
,
(
i
[
'reference'
],
i
[
'language'
],
print
'
\
t
'
.
join
(
[
'"%s"'
%
x
for
x
in
(
i
[
'reference'
],
i
[
'language'
],
i
[
'business_field'
],
i
[
'title'
],
i
[
'description'
],
i
[
'field_path'
])
)
)
i
[
'field_path'
])
]
)
return
printed
else
:
portal_catalog
=
context
.
portal_catalog
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.py
View file @
9f2fa835
...
...
@@ -2,10 +2,10 @@ result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_
if
export_tsv
:
for
i
in
result
:
print
'
\
t
'
.
join
(
map
(
lambda
x
:
'"%s"'
%
x
,
(
i
[
'reference'
],
i
[
'language'
],
print
'
\
t
'
.
join
(
[
'"%s"'
%
x
for
x
in
(
i
[
'reference'
],
i
[
'language'
],
i
[
'business_field'
],
i
[
'title'
],
i
[
'description'
],
i
[
'field_path'
])
)
)
i
[
'field_path'
])
]
)
return
printed
else
:
portal_catalog
=
context
.
portal_catalog
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromWorkflow.py
View file @
9f2fa835
...
...
@@ -2,9 +2,11 @@ result = context.GlossaryModule_getTermDictListFromWorkflow(template_list)
if
export_tsv
:
for
i
in
result
:
print
'
\
t
'
.
join
(
map
(
lambda
x
:
'"%s"'
%
x
,
(
i
[
'reference'
],
i
[
'language'
],
print
'
\
t
'
.
join
([
'"%s"'
%
x
for
x
in
(
i
[
'reference'
],
i
[
'language'
],
i
[
'business_field'
],
i
[
'title'
],
i
[
'description'
],
i
[
'workflow_id'
])))
i
[
'title'
],
i
[
'description'
],
i
[
'workflow_id'
])])
return
printed
else
:
portal_catalog
=
context
.
portal_catalog
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.py
View file @
9f2fa835
from
Products.ERP5Type.Document
import
newTempBase
result
=
[]
portal_catalog
=
context
.
portal_catalog
portal_skins
=
context
.
portal_skins
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldPortalTypeList.py
View file @
9f2fa835
from
Products.ERP5Type.Document
import
newTempBase
result
=
[]
portal_catalog
=
context
.
portal_catalog
portal_skins
=
context
.
portal_skins
def
get_term_list
(
reference
):
reference
=
reference
.
rsplit
(
' Module'
,
1
)[
0
]
...
...
@@ -26,7 +23,7 @@ for reference in portal_type_list:
field_description
=
portal_type
.
description
if
len
(
term_list
)
==
1
and
\
term_list
[
0
].
getDescription
()
==
field_description
:
continue
continue
line
=
newTempBase
(
context
,
'tmp_glossary_field_%s'
%
c
)
line
.
edit
(
field_path
=
reference
,
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
View file @
9f2fa835
from
Products.ERP5Type.Document
import
newTempBase
marker
=
[]
result
=
[]
portal_catalog
=
context
.
portal_catalog
portal_workflow
=
context
.
portal_workflow
...
...
@@ -40,7 +39,7 @@ line_list = []
c
=
0
item_dict
=
{}
for
business_field
in
business_field_list
:
for
wf_item
,
reference
,
type
in
get_obj_and_reference_list
(
business_field
):
for
wf_item
,
reference
,
type
_
in
get_obj_and_reference_list
(
business_field
):
term_list
=
get_term_list
(
business_field
,
reference
)
#if not term_list:
# continue
...
...
@@ -49,21 +48,21 @@ for business_field in business_field_list:
item_dict
[
wf_item
]
=
True
c
+=
1
if
type
==
'workflow'
:
if
type
_
==
'workflow'
:
wf_item_path
=
wf_item
.
id
wf_item_title
=
wf_item
.
title
elif
type
==
'state'
:
elif
type
_
==
'state'
:
wf_item_path
=
'%s/states/%s'
%
(
wf_item
.
aq_parent
.
aq_parent
.
id
,
wf_item
.
id
)
wf_item_title
=
wf_item
.
title
elif
type
==
'transition'
:
elif
type
_
==
'transition'
:
wf_item_path
=
'%s/transitions/%s'
%
(
wf_item
.
aq_parent
.
aq_parent
.
id
,
wf_item
.
id
)
wf_item_title
=
wf_item
.
title
else
:
# type == 'action'
else
:
# type
_
== 'action'
wf_item_path
=
'%s/transitions/%s_actbox_name'
%
(
wf_item
.
aq_parent
.
aq_parent
.
id
,
wf_item
.
id
)
wf_item_title
=
wf_item
.
actbox_name
wf_item_description
=
wf_item
.
description
if
type
==
'transition'
and
wf_item_path
.
endswith
(
'_action'
):
if
type
_
==
'transition'
and
wf_item_path
.
endswith
(
'_action'
):
if
len
(
term_list
)
==
1
and
\
term_list
[
0
].
getTitle
()
+
' Action'
==
wf_item_title
and
\
term_list
[
0
].
getDescription
()
==
wf_item_description
:
...
...
@@ -76,7 +75,7 @@ for business_field in business_field_list:
line
=
newTempBase
(
context
,
'tmp_glossary_wf_item_%s'
%
c
)
line
.
edit
(
wf_item_path
=
wf_item_path
,
wf_item_type
=
type
,
wf_item_type
=
type
_
,
wf_item_title
=
wf_item_title
,
wf_item_edit_url
=
"%s/manage_properties"
%
wf_item
.
absolute_url
(),
wf_item_description
=
wf_item_description
,
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.py
View file @
9f2fa835
...
...
@@ -14,13 +14,13 @@ msgstr %s
return
MESSAGE_TEMPLATE
%
dict
(
english
=
english
,
translation
=
translation
)
def
format
(
string
):
def
format
String
(
string
):
line_list
=
string
.
splitlines
(
True
)
length
=
len
(
line_list
)
if
length
==
1
:
return
'"%s"'
%
string
.
replace
(
'"'
,
'
\
\
"'
).
replace
(
'
\
n
'
,
'
\
\
n'
)
else
:
return
'
\
n
'
.
join
([
'""'
]
+
[
format
(
i
)
for
i
in
line_list
])
return
'
\
n
'
.
join
([
'""'
]
+
[
format
String
(
i
)
for
i
in
line_list
])
# po header
now
=
DateTime
().
toZone
(
'UTC'
).
strftime
(
"%Y-%m-%d %H:%M+0000"
)
...
...
@@ -43,7 +43,6 @@ for i in catalog(portal_type='Glossary Term',
language_id
=
language
):
term
=
i
.
getObject
()
reference
=
term
.
getReference
()
business_field
=
term
.
getBusinessField
()
english_term
=
catalog
.
getResultValue
(
portal_type
=
'Glossary Term'
,
validation_state
=
'validated'
,
...
...
@@ -52,7 +51,6 @@ for i in catalog(portal_type='Glossary Term',
business_field_uid
=
term
.
getBusinessFieldUid
())
if
english_term
is
None
:
continue
raise
ValueError
,
'Corresponding English term to "%s" does not exist in glossary.'
%
term
.
Title
()
translated_title
=
term
.
getTitle
()
translated_description
=
term
.
getDescription
()
...
...
@@ -65,8 +63,8 @@ for i in catalog(portal_type='Glossary Term',
if
not
english_title
:
raise
ValueError
,
'Title of corresponding English term(%s) to "%s" is empty.'
%
(
english_relative_url
,
translated_title
)
if
translated_title
!=
english_title
:
print
formatMessage
(
english
=
format
(
english_title
),
translation
=
format
(
translated_title
),
print
formatMessage
(
english
=
format
String
(
english_title
),
translation
=
format
String
(
translated_title
),
term
=
term
)
if
translated_description
:
...
...
@@ -74,8 +72,8 @@ for i in catalog(portal_type='Glossary Term',
raise
ValueError
,
'Description of corresponding English term(%s) to "%s" is empty.'
%
(
english_relative_url
,
translated_description
)
if
translated_description
!=
english_description
:
print
formatMessage
(
english
=
format
(
english_description
),
translation
=
format
(
translated_description
),
print
formatMessage
(
english
=
format
String
(
english_description
),
translation
=
format
String
(
translated_description
),
term
=
term
)
RESPONSE
=
context
.
REQUEST
.
RESPONSE
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.py
View file @
9f2fa835
...
...
@@ -17,20 +17,20 @@ for i in property_sheet_list:
dic
=
{}
for
i
in
all_field_list
:
id
=
i
.
getId
()
id
_
=
i
.
getId
()
title
=
i
.
get_value
(
'title'
)
or
''
skin_id
=
i
.
aq_parent
.
aq_parent
.
getId
()
prefix
=
'erp5_'
if
skin_id
.
startswith
(
prefix
):
skin_id
=
skin_id
[
len
(
prefix
):]
if
id
.
startswith
(
'my_'
):
if
id
_
.
startswith
(
'my_'
):
for
p
in
properties
:
if
id
==
'my_%s'
%
p
:
if
id
_
==
'my_%s'
%
p
:
key
=
(
p
,
skin_id
,
title
)
dic
[
key
]
=
i
if
id
.
startswith
(
'your_'
):
if
id
_
.
startswith
(
'your_'
):
for
p
in
properties
:
if
id
==
'your_%s'
%
p
:
if
id
_
==
'your_%s'
%
p
:
key
=
(
p
,
skin_id
,
title
)
dic
[
key
]
=
i
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_updatePortalTypeByTerm.py
View file @
9f2fa835
prefix
=
'field_listbox_term_'
prefix_length
=
len
(
prefix
)
portal_types
=
context
.
portal_types
portal_catalog
=
context
.
portal_catalog
for
i
in
kw
.
keys
():
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_getSimulationTree.py
View file @
9f2fa835
...
...
@@ -2,11 +2,11 @@
# Author: Lukasz Nowak <lukasz.nowak@ventis.com.pl>
# Copyright 2007 Ventis s. c.
# SYNOPSIS
# This script ex
c
tracts simulations (Applied Rule and Simulation Movement) for context.
# This script extracts simulations (Applied Rule and Simulation Movement) for context.
# If start_path is given it instead extracts tree with root as given start_path.
def
getByRecurse
(
obj
,
rv
=
[]
):
def
getByRecurse
(
obj
):
rv
=
[]
for
o
in
[
q
.
getObject
()
for
q
in
obj
.
searchFolder
()]:
rv
.
append
(
getByRecurse
(
o
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
View file @
9f2fa835
...
...
@@ -74,10 +74,10 @@ for i in form_list:
if
(
i
.
getId
().
endswith
(
'FieldLibrary'
)):
continue
add_message
(
i
.
title
,
portal_url
.
getRelativeContentURL
(
i
))
for
group
,
list
in
i
.
groups
.
items
():
for
group
,
list
_
in
i
.
groups
.
items
():
if
group
==
'hidden'
:
continue
for
j
in
(
i
[
x
]
for
x
in
list
):
for
j
in
(
i
[
x
]
for
x
in
list
_
):
add_message
(
j
.
get_value
(
'title'
),
portal_url
.
getRelativeContentURL
(
j
))
if
j
.
get_value
(
'editable'
):
add_message
(
j
.
get_value
(
'description'
),
portal_url
.
getRelativeContentURL
(
j
))
...
...
@@ -104,20 +104,19 @@ for i in page_template_list:
#
# Workflow
#
s_title_list
=
[]
for
i
in
context
.
portal_workflow
.
objectValues
():
add_message
(
i
.
title_or_id
(),
portal_url
.
getRelativeContentURL
(
i
))
if
not
i
.
states
:
continue
for
s
in
i
.
states
.
values
():
s_title
=
s
.
title
if
s_title
:
# adding a context in msg_id for more precise translation
msg_id
=
getMessageIdWithContext
(
s_title
,
'state'
,
i
.
id
)
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
s
))
# also use state title as msg_id for compatibility
add_message
(
s_title
,
portal_url
.
getRelativeContentURL
(
s
))
s_title
=
s
.
title
if
s_title
:
# adding a context in msg_id for more precise translation
msg_id
=
getMessageIdWithContext
(
s_title
,
'state'
,
i
.
id
)
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
s
))
# also use state title as msg_id for compatibility
add_message
(
s_title
,
portal_url
.
getRelativeContentURL
(
s
))
if
not
i
.
transitions
:
continue
...
...
@@ -164,13 +163,13 @@ for property_sheet in context.portal_property_sheets.objectValues():
#
# Output
#
def
format
(
string
):
def
format
String
(
string
):
line_list
=
string
.
split
(
'
\
n
'
)
length
=
len
(
line_list
)
if
length
==
1
:
return
'"%s"'
%
string
.
replace
(
'"'
,
'
\
\
"'
)
else
:
return
'
\
n
'
.
join
([
'""'
]
+
[
format
(
i
)
for
i
in
line_list
])
return
'
\
n
'
.
join
([
'""'
]
+
[
format
String
(
i
)
for
i
in
line_list
])
print
'''msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
...
...
@@ -188,7 +187,7 @@ for message in message_list:
comment_list
=
message_dict
[
message
]
comment_list
.
sort
()
comment
=
'
\
n
'
.
join
([(
'#: %s'
%
i
)
for
i
in
comment_list
])
print
MESSAGE_TEMPLATE
%
(
comment
,
format
(
message
))
print
MESSAGE_TEMPLATE
%
(
comment
,
format
String
(
message
))
RESPONSE
=
context
.
REQUEST
.
RESPONSE
RESPONSE
.
setHeader
(
'Content-disposition'
,
'attachment;filename=translation.pot'
)
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_setSkinCache.py
View file @
9f2fa835
...
...
@@ -4,9 +4,9 @@ result = []
def
setCache
(
skin
):
for
o
in
skin
.
objectValues
():
id
=
o
.
id
if
callable
(
id
):
id
=
id
()
if
o
.
meta_type
in
(
'Image'
,
'File'
,
'Filesystem Image'
,
'Filesystem File'
)
or
id
.
endswith
(
'.css'
)
or
id
.
endswith
(
'.js'
):
id
_
=
o
.
id
if
callable
(
id
_
):
id_
=
id_
()
if
o
.
meta_type
in
(
'Image'
,
'File'
,
'Filesystem Image'
,
'Filesystem File'
)
or
id
_
.
endswith
(
'.css'
)
or
id_
.
endswith
(
'.js'
):
if
o
.
ZCacheable_getManagerId
()
!=
cache_manager_id
:
o
.
ZCacheable_setManagerId
(
cache_manager_id
)
result
.
append
(
o
.
absolute_url
(
relative
=
1
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.py
View file @
9f2fa835
...
...
@@ -6,7 +6,7 @@ for form_path, form in context.ZopeFind(
context
.
portal_skins
,
obj_metatypes
=
[
'ERP5 Form'
],
search_sub
=
1
):
try
:
groups
=
form
.
get_groups
()
except
AttributeError
,
e
:
except
AttributeError
as
e
:
print
"%s is broken: %s"
%
(
form_path
,
e
)
if
'not_assigned'
in
groups
:
print
'Not assigned fields in %s: %s'
%
(
form_path
,
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnCheckout.py
View file @
9f2fa835
...
...
@@ -10,4 +10,3 @@ except SubversionLoginError, error1 :
context
.
REQUEST
.
set
(
'portal_status_message'
,
'Server needs authentication, no cookie found'
)
return
context
.
asContext
(
caller
=
'info'
,
realm
=
error1
.
getRealm
(),
username
=
vcs_tool
.
getPreferredUsername
()).
BusinessTemplate_viewSvnLogin
()
return
entry_dict
return
context
.
asContext
(
entry_dict
=
entry_dict
).
BusinessTemplate_viewSvnInfos
()
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.py
View file @
9f2fa835
request
=
context
.
REQUEST
if
caller_kw
is
None
:
caller_kw
=
{}
trust_dict
=
dict
((
x
,
request
[
x
])
for
x
in
(
'valid_until'
,
'hostname'
,
'realm'
,
'finger_print'
,
'valid_from'
,
'issuer_dname'
,
'failures'
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doSvnSslTrust.xml
View file @
9f2fa835
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
caller, caller_kw=
{}
, added=(), removed=(), modified=(), changelog=None, **kw
</string>
</value>
<value>
<string>
caller, caller_kw=
None
, added=(), removed=(), modified=(), changelog=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogGlobal.py
View file @
9f2fa835
from
erp5.component.module.SubversionClient
import
SubversionSSLTrustError
,
SubversionLoginError
from
Products.ERP5Type.Document
import
newTempBase
# get selected business templates
p
=
context
.
getPortalObject
()
selection_name
=
'business_template_selection'
# harcoded because we can also get delete_selection
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.py
View file @
9f2fa835
if
caller_kw
is
None
:
caller_kw
=
{}
context
.
getVcsTool
().
setLogin
(
auth
,
user
,
password
)
return
context
.
restrictedTraverse
(
caller
)(
**
caller_kw
)
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsLogin.xml
View file @
9f2fa835
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
user, password, auth, caller, caller_kw=
{}
, added=(), modified=(), removed=(), changelog=None, **kw
</string>
</value>
<value>
<string>
user, password, auth, caller, caller_kw=
None
, added=(), modified=(), removed=(), changelog=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_resolveConflicted.py
View file @
9f2fa835
request
=
context
.
REQUEST
try
:
files_list
=
context
.
REQUEST
[
'uids'
]
files_list
=
request
[
'uids'
]
except
KeyError
:
message
=
'You MUST select at least one file.'
else
:
context
.
getVcsTool
().
resolved
(
files_list
)
message
=
'Conflicted files resolved successfully.'
request
.
set
(
"portal_status_message"
,
message
)
return
context
.
BusinessTemplate_viewConflicted
()
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/ERP5VCS_doCreateJavaScriptStatus.js.py
View file @
9f2fa835
if
"files"
in
context
.
REQUEST
.
keys
():
files
=
context
.
REQUEST
[
"files"
];
else
:
files
=
None
;
return
'''
var tree = null;
var business_template;
...
...
bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_event_workflow/scripts/BugEvent_sendNotification.py
View file @
9f2fa835
...
...
@@ -56,9 +56,9 @@ lines_list = bug.searchFolder(portal_type='Bug Line', sort_on=(("id", "DESC"),),
bug_message_list
.
extend
(
lines_list
)
message_count
=
len
(
bug_message_list
)
+
1
for
message
in
bug_message_list
:
message_count
-=
1
text
=
message
.
asText
()
body
+=
"""
message_count
-=
1
text
=
message
.
asText
()
body
+=
"""
++++++ Message #%s submitted by %s on %s ++++++
%s
"""
%
(
message_count
,
message
.
getSourceTitle
(
''
),
...
...
bt5/erp5_forge/bt/skip_coding_style_test
deleted
100644 → 0
View file @
6f622d9b
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