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
Alexander Emmerich
erp5
Commits
c11e08ba
Commit
c11e08ba
authored
Apr 20, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: 2to3: iteritems/itervalues.
parent
5b1d72b4
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
105 additions
and
106 deletions
+105
-106
product/CMFActivity/ActivityBuffer.py
product/CMFActivity/ActivityBuffer.py
+1
-1
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+10
-10
product/CMFActivity/sbalance.py
product/CMFActivity/sbalance.py
+1
-1
product/CMFCategory/Filter.py
product/CMFCategory/Filter.py
+1
-1
product/DeadlockDebugger/dumper.py
product/DeadlockDebugger/dumper.py
+1
-1
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+32
-32
product/ERP5/Document/Resource.py
product/ERP5/Document/Resource.py
+2
-2
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+1
-1
product/ERP5/Extensions/Diff.py
product/ERP5/Extensions/Diff.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Amount.py
...entTemplateItem/portal_components/document.erp5.Amount.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.AppliedRule.py
...mplateItem/portal_components/document.erp5.AppliedRule.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.BusinessProcess.py
...teItem/portal_components/document.erp5.BusinessProcess.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ContributionPredicate.py
.../portal_components/document.erp5.ContributionPredicate.py
+2
-2
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.SimulationMovement.py
...tem/portal_components/document.erp5.SimulationMovement.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
...Item/portal_components/mixin.erp5.AmountGeneratorMixin.py
+2
-2
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin.py
...ateItem/portal_components/mixin.erp5.DiscoverableMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.GeneratedAmountList.py
...Item/portal_components/module.erp5.GeneratedAmountList.py
+1
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.WebDAVSupport.py
...mplateItem/portal_components/module.erp5.WebDAVSupport.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py
...portal_skins/erp5_core/CategoryTool_importCategoryFile.py
+2
-2
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.RuleTool.py
...onentTemplateItem/portal_components/tool.erp5.RuleTool.py
+1
-1
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
...emplateItem/portal_components/tool.erp5.SimulationTool.py
+3
-4
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeTranslationQuery.py
...alog/erp5_mysql_innodb/SQLCatalog_makeTranslationQuery.py
+1
-1
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.py
...em/portal_skins/erp5_xhtml_style/Workflow_statusModify.py
+1
-1
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
+15
-15
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+8
-8
product/ERP5/tests/testSpellChecking.py
product/ERP5/tests/testSpellChecking.py
+2
-2
product/ERP5/tests/utils.py
product/ERP5/tests/utils.py
+1
-1
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+9
-9
product/ERP5Catalog/Document/ERP5Catalog.py
product/ERP5Catalog/Document/ERP5Catalog.py
+1
-1
No files found.
product/CMFActivity/ActivityBuffer.py
View file @
c11e08ba
...
...
@@ -59,7 +59,7 @@ class ActivityBuffer(TM):
try
:
activity_tool
=
self
.
activity_tool
# Try to push all messages
for
activity
,
message_list
in
s
elf
.
message_list_dict
.
iteritems
(
):
for
activity
,
message_list
in
s
ix
.
iteritems
(
self
.
message_list_dict
):
activity
.
prepareQueueMessageList
(
activity_tool
,
message_list
)
self
.
message_list_dict
.
clear
()
self
.
activity_tool
=
None
...
...
product/CMFActivity/ActivityTool.py
View file @
c11e08ba
...
...
@@ -702,7 +702,7 @@ class ActivityTool (BaseTool):
security
.
declarePrivate
(
'initialize'
)
def
initialize
(
self
):
self
.
maybeMigrateConnectionClass
()
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
activity
.
initialize
(
self
,
clear
=
False
)
# Remove old skin if any.
skins_tool
=
self
.
getPortalObject
().
portal_skins
...
...
@@ -1328,7 +1328,7 @@ class ActivityTool (BaseTool):
Distribute load
"""
# Call distribute on each queue
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
activity
.
distribute
(
aq_inner
(
self
),
node_count
)
security
.
declarePublic
(
'tic'
)
...
...
@@ -1392,7 +1392,7 @@ class ActivityTool (BaseTool):
quote
=
db
.
string_literal
return
bool
(
db
.
query
(
"(%s)"
%
") UNION ALL ("
.
join
(
activity
.
hasActivitySQL
(
quote
,
path
=
path
,
**
kw
)
for
activity
in
activity_dict
.
itervalues
(
)))[
1
])
for
activity
in
six
.
itervalues
(
activity_dict
)))[
1
])
security
.
declarePrivate
(
'getActivityBuffer'
)
def
getActivityBuffer
(
self
,
create_if_not_found
=
True
):
...
...
@@ -1494,7 +1494,7 @@ class ActivityTool (BaseTool):
object_path
=
obj
else
:
object_path
=
obj
.
getPhysicalPath
()
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
activity
.
flush
(
aq_inner
(
self
),
object_path
,
invoke
=
invoke
,
**
kw
)
def
invoke
(
self
,
message
):
...
...
@@ -1629,7 +1629,7 @@ class ActivityTool (BaseTool):
error_log
.
raising
(
exc_info
)
else
:
# Note there can be partial failures.
for
m
,
expanded_object_list
in
message_dict
.
iteritems
(
):
for
m
,
expanded_object_list
in
six
.
iteritems
(
message_dict
):
result_list
=
[]
for
result
in
expanded_object_list
:
try
:
...
...
@@ -1741,7 +1741,7 @@ class ActivityTool (BaseTool):
"""
Recreate tables, clearing all activities
"""
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
activity
.
initialize
(
self
,
clear
=
True
)
if
RESPONSE
is
not
None
:
...
...
@@ -1770,7 +1770,7 @@ class ActivityTool (BaseTool):
return
activity_dict
[
activity
].
getMessageList
(
aq_inner
(
self
),
**
kw
)
message_list
=
[]
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
try
:
message_list
+=
activity
.
getMessageList
(
aq_inner
(
self
),
**
kw
)
except
AttributeError
:
...
...
@@ -1800,7 +1800,7 @@ class ActivityTool (BaseTool):
quote
=
db
.
string_literal
return
sum
(
x
for
x
,
in
db
.
query
(
"(%s)"
%
") UNION ALL ("
.
join
(
activity
.
countMessageSQL
(
quote
,
**
kw
)
for
activity
in
activity_dict
.
itervalues
(
)))[
1
])
for
activity
in
six
.
itervalues
(
activity_dict
)))[
1
])
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'newActiveProcess'
)
def
newActiveProcess
(
self
,
REQUEST
=
None
,
**
kw
):
...
...
@@ -1813,11 +1813,11 @@ class ActivityTool (BaseTool):
security
.
declarePrivate
(
'getSQLTableNameSet'
)
def
getSQLTableNameSet
(
self
):
return
[
x
.
sql_table
for
x
in
activity_dict
.
itervalues
(
)]
return
[
x
.
sql_table
for
x
in
six
.
itervalues
(
activity_dict
)]
# Required for tests (time shift)
def
timeShift
(
self
,
delay
):
for
activity
in
activity_dict
.
itervalues
(
):
for
activity
in
six
.
itervalues
(
activity_dict
):
activity
.
timeShift
(
aq_inner
(
self
),
delay
)
InitializeClass
(
ActivityTool
)
product/CMFActivity/sbalance.py
100644 → 100755
View file @
c11e08ba
...
...
@@ -118,7 +118,7 @@ class Balancer:
if
addr
not
in
self
.
disabled_server_dict
:
count_dict
[
addr
]
=
0
expired_server_list
=
[]
for
key
,
value
in
s
elf
.
sticked_server_dict
.
items
(
):
for
key
,
value
in
s
ix
.
iteritems
(
self
.
sticked_server_dict
):
if
self
.
debug
:
print
(
'cur_time = %f, value.atime = %f'
%
(
cur_time
,
value
.
atime
))
if
cur_time
>
value
.
atime
+
60
*
10
:
...
...
product/CMFCategory/Filter.py
View file @
c11e08ba
...
...
@@ -75,7 +75,7 @@ class Filter(Implicit):
return
False
if
self
.
filter_leave
and
not
self
.
_isNode
(
context
):
return
False
for
k
,
v
in
s
elf
.
filter_dict
.
items
(
):
for
k
,
v
in
s
ix
.
iteritems
(
self
.
filter_dict
):
if
type
(
v
)
in
(
type
([]),
type
(())):
if
context
.
getProperty
(
k
)
not
in
v
:
return
False
...
...
product/DeadlockDebugger/dumper.py
View file @
c11e08ba
...
...
@@ -39,7 +39,7 @@ def dump_threads():
this_thread_id
=
thread
.
get_ident
()
now
=
time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
res
=
[
"Threads traceback dump at %s
\
n
"
%
now
]
for
thread_id
,
frame
in
_current_frames
().
iteritems
(
):
for
thread_id
,
frame
in
six
.
iteritems
(
_current_frames
()
):
if
thread_id
==
this_thread_id
:
continue
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
c11e08ba
...
...
@@ -802,7 +802,7 @@ class ObjectTemplateItem(BaseTemplateItem):
if
len
(
self
.
_objects
.
keys
())
==
0
:
return
path
=
self
.
__class__
.
__name__
+
'/'
for
key
,
obj
in
s
elf
.
_objects
.
iteritems
(
):
for
key
,
obj
in
s
ix
.
iteritems
(
self
.
_objects
):
# Back compatibility with filesystem Documents
if
isinstance
(
obj
,
str
):
if
not
key
.
startswith
(
path
):
...
...
@@ -1465,7 +1465,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# get a jar
connection
=
self
.
getConnection
(
obj
)
# import subobjects
for
subobject_id
,
subobject_data
in
s
ubobjects_dict
.
iteritems
(
):
for
subobject_id
,
subobject_data
in
s
ix
.
iteritems
(
subobjects_dict
):
try
:
if
obj
.
_getOb
(
subobject_id
,
None
)
is
None
:
subobject_data
.
seek
(
0
)
...
...
@@ -1551,7 +1551,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# defined on the former form
previous_group_id
=
None
if
not
widget_in_form
:
for
old_group_id
,
old_group_values
in
old_groups_dict
.
iteritems
(
):
for
old_group_id
,
old_group_values
in
six
.
iteritems
(
old_groups_dict
):
if
widget_id
in
old_group_values
:
previous_group_id
=
old_group_id
# if we find same group in new one, add widget to it
...
...
@@ -1565,7 +1565,7 @@ class ObjectTemplateItem(BaseTemplateItem):
new_groups_dict
[
'not_assigned'
]
=
[
widget_id
,]
obj
.
group_list
=
list
(
obj
.
group_list
)
+
[
'not_assigned'
]
# second check all widget_id in order are in form
for
group_id
,
group_value_list
in
new_groups_dict
.
iteritems
(
):
for
group_id
,
group_value_list
in
six
.
iteritems
(
new_groups_dict
):
for
widget_id
in
tuple
(
group_value_list
):
if
widget_id
not
in
widget_id_list
:
# if we don't find the widget id in the form
...
...
@@ -1580,7 +1580,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# element of object_key_list, and not just these objects themselves.
# XXX: why does update_dict contain the path of documents not managed
# by current instance ?
for
path
,
action
in
update_dict
.
iteritems
(
):
for
path
,
action
in
six
.
iteritems
(
update_dict
):
if
action
not
in
(
'remove'
,
'save_and_remove'
):
continue
path_match
=
path
+
'/'
...
...
@@ -1775,7 +1775,7 @@ class PathTemplateItem(ObjectTemplateItem):
if
update_dict
:
def
updateLocalRolesOnDocument
():
for
portal_type
,
obj_list
in
update_dict
.
iteritems
(
):
for
portal_type
,
obj_list
in
six
.
iteritems
(
update_dict
):
update
=
p
.
portal_types
[
portal_type
].
updateLocalRolesOnDocument
for
obj
in
obj_list
:
update
(
obj
)
...
...
@@ -1839,7 +1839,7 @@ class ToolTemplateItem(PathTemplateItem):
PathTemplateItem
.
install
(
self
,
context
,
trashbin
,
**
kw
)
portal
=
context
.
getPortalObject
()
types_tool
=
portal
.
portal_types
for
type_container_id
,
obj
in
s
elf
.
_objects
.
iteritems
(
):
for
type_container_id
,
obj
in
s
ix
.
iteritems
(
self
.
_objects
):
if
(
interfaces
.
ITypeProvider
.
providedBy
(
obj
)
and
type_container_id
!=
types_tool
.
id
and
type_container_id
not
in
types_tool
.
type_provider_list
):
...
...
@@ -2006,7 +2006,7 @@ class SkinTemplateItem(ObjectTemplateItem):
# We must install/update an ERP5 Form if one of its widget is modified.
# This allow to keep the widget order and the form layout after an update
# from a BT to another one.
for
(
bt_obj_path
,
bt_obj
)
in
s
elf
.
_objects
.
items
(
):
for
(
bt_obj_path
,
bt_obj
)
in
s
ix
.
iteritems
(
list
(
self
.
_objects
)
):
if
getattr
(
bt_obj
,
'meta_type'
,
None
)
==
'ERP5 Form'
:
# search sub-objects of ERP5 Forms that are marked as "modified"
for
upd_obj_path
in
modified_object_list
.
keys
():
...
...
@@ -2231,7 +2231,7 @@ class RegisteredVersionPrioritySelectionTemplateItem(BaseTemplateItem):
update_dict
=
kw
.
get
(
'object_to_update'
)
force
=
kw
.
get
(
'force'
)
registered_name_list
=
set
(
portal
.
getVersionPriorityNameList
())
for
new_version
,
new_priority
in
s
elf
.
_objects
.
iteritems
(
):
for
new_version
,
new_priority
in
s
ix
.
iteritems
(
self
.
_objects
):
action
=
update_dict
.
get
(
new_version
)
if
(
not
action
or
action
==
'nothing'
)
and
not
force
:
continue
...
...
@@ -2276,7 +2276,7 @@ class RegisteredVersionPrioritySelectionTemplateItem(BaseTemplateItem):
def
preinstall
(
self
,
context
,
installed_item
,
**
kw
):
modified_object_list
=
{}
class_name_prefix
=
self
.
__class__
.
__name__
[:
-
12
]
for
path
,
new_object
in
s
elf
.
_objects
.
iteritems
(
):
for
path
,
new_object
in
s
ix
.
iteritems
(
self
.
_objects
):
old_object
=
installed_item
.
_objects
.
get
(
path
)
if
old_object
is
not
None
:
# Compare object to see it there is any change
...
...
@@ -2328,14 +2328,14 @@ class WorkflowTemplateItem(ObjectTemplateItem):
modified_object_dict
=
ObjectTemplateItem
.
preinstall
(
self
,
context
,
installed_item
,
**
kw
)
modified_workflow_dict
=
{}
for
modified_object
,
state
in
modified_object_dict
.
iteritems
(
):
for
modified_object
,
state
in
six
.
iteritems
(
modified_object_dict
):
path
=
modified_object
.
split
(
'/'
)
if
len
(
path
)
>
2
:
modified_workflow_dict
.
setdefault
(
'/'
.
join
(
path
[:
2
]),
(
'Modified'
,
state
[
1
]))
else
:
modified_workflow_dict
[
modified_object
]
=
state
removed_workflow_id_list
=
[
x
[
0
].
split
(
'/'
,
1
)[
1
]
\
for
x
in
modified_workflow_dict
.
iteritems
(
)
\
for
x
in
six
.
iteritems
(
modified_workflow_dict
)
\
if
x
[
1
][
0
]
==
'Removed'
]
if
len
(
removed_workflow_id_list
)
>
0
:
installed_chain_list
=
[[
y
.
strip
()
for
y
in
x
.
split
(
'|'
)]
for
x
in
\
...
...
@@ -2476,8 +2476,8 @@ class PortalTypeTemplateItem(ObjectTemplateItem):
force
=
kw
.
get
(
'force'
)
# We now need to setup the list of workflows corresponding to
# each portal type
for
path
,
obj
in
s
elf
.
_objects
.
iteritems
(
):
if
update_dict
.
has_key
(
path
)
or
force
:
for
path
,
obj
in
s
ix
.
iteritems
(
self
.
_objects
):
if
path
in
update_dict
or
force
:
if
not
force
:
action
=
update_dict
[
path
]
if
action
==
'nothing'
:
...
...
@@ -2565,7 +2565,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
# and if the template is not built,
# it should be removed here from the key
new_objects
=
PersistentMapping
()
for
key
,
value
in
s
elf
.
_objects
.
iteritems
(
):
for
key
,
value
in
s
ix
.
iteritems
(
self
.
_objects
):
new_key
=
deepcopy
(
key
)
if
'portal_type_workflow_chain/'
in
key
:
new_key
=
new_key
.
replace
(
'portal_type_workflow_chain/'
,
''
)
...
...
@@ -2681,7 +2681,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
modified_object_list
=
{}
new_dict
=
PersistentMapping
()
# Fix key from installed bt if necessary
for
key
,
value
in
installed_item
.
_objects
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
installed_item
.
_objects
):
if
not
'portal_type_workflow_chain/'
in
key
:
key
=
'portal_type_workflow_chain/%s'
%
(
key
)
new_dict
[
key
]
=
value
...
...
@@ -2786,7 +2786,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
modified_object_list
=
{}
new_dict
=
PersistentMapping
()
# fix key if necessary in installed bt for diff
for
key
,
value
in
installed_item
.
_objects
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
installed_item
.
_objects
):
if
self
.
class_property
not
in
key
:
key
=
'%s/%s'
%
(
self
.
class_property
,
key
)
new_dict
[
key
]
=
value
...
...
@@ -2995,8 +2995,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
obj
=
self
.
_objects
[
path
]
method_id
=
obj
.
id
xml_data
=
'<catalog_method>'
if
self
.
_method_properties
.
has_key
(
method_id
)
:
for
method_property
,
value
in
s
elf
.
_method_properties
[
method_id
].
items
(
):
if
method_id
in
self
.
_method_properties
:
for
method_property
,
value
in
s
ix
.
iteritems
(
self
.
_method_properties
[
method_id
]
):
xml_data
+=
'
\
n
<item key="%s" type="int">'
%
(
method_property
,)
xml_data
+=
'
\
n
<value>%s</value>'
%
(
value
,)
xml_data
+=
'
\
n
</item>'
...
...
@@ -3062,8 +3062,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
if
force
:
# get all objects
values
=
self
.
_objects
.
values
()
else
:
# get only selected object
for
key
,
value
in
s
elf
.
_objects
.
iteritems
(
):
if
update_dict
.
has_key
(
key
)
or
force
:
for
key
,
value
in
s
ix
.
iteritems
(
self
.
_objects
):
if
key
in
update_dict
or
force
:
if
not
force
:
action
=
update_dict
[
key
]
if
action
==
'nothing'
:
...
...
@@ -3377,12 +3377,12 @@ class ActionTemplateItem(ObjectTemplateItem):
if
action
.
priority
>
new_priority
:
move_down_list
.
append
(
str
(
index
))
obj
.
moveDownActions
(
selections
=
tuple
(
move_down_list
))
for
path
,
action_dict
in
portal_type_dict
.
iteritems
(
):
for
path
,
action_dict
in
six
.
iteritems
(
portal_type_dict
):
container
=
p
.
unrestrictedTraverse
(
path
)
container
.
manage_delObjects
([
obj
.
id
for
obj
in
container
.
getActionInformationList
()
if
obj
.
getReference
()
in
action_dict
])
for
name
,
obj
in
action_dict
.
iteritems
(
):
for
name
,
obj
in
six
.
iteritems
(
action_dict
):
container
.
_importOldAction
(
obj
).
aq_base
def
uninstall
(
self
,
context
,
**
kw
):
...
...
@@ -3436,7 +3436,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
self
.
_objects
[
relative_url
]
=
type_role_list
=
[]
for
role
in
obj
.
getRoleInformationList
():
type_role_dict
=
{}
for
k
,
v
in
aq_base
(
role
).
__getstate__
().
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
aq_base
(
role
).
__getstate__
()
):
if
k
==
'condition'
:
if
not
v
:
continue
...
...
@@ -3735,8 +3735,8 @@ class ModuleTemplateItem(BaseTemplateItem):
force
=
kw
.
get
(
'force'
)
valid_permissions
=
dict
.
fromkeys
([
x
[
0
]
for
x
in
context
.
ac_inherited_permissions
(
all
=
1
)])
for
path
,
mapping
in
s
elf
.
_objects
.
iteritems
(
):
if
update_dict
.
has_key
(
path
)
or
force
:
for
path
,
mapping
in
s
ix
.
iteritems
(
self
.
_objects
):
if
path
in
update_dict
or
force
:
if
not
force
:
action
=
update_dict
[
path
]
if
action
==
'nothing'
:
...
...
@@ -3905,7 +3905,7 @@ class FilesystemDocumentTemplateItem(BaseTemplateItem):
"""Conversion of magically uniqued paths to real ones"""
remove_object_dict
=
kw
.
get
(
'remove_object_dict'
,
{})
kw
[
'remove_object_dict'
]
=
{
self
.
_getPath
(
k
):
v
for
k
,
v
in
remove_object_dict
.
iteritems
(
)
for
k
,
v
in
six
.
iteritems
(
remove_object_dict
)
if
k
.
startswith
(
self
.
getTemplateTypeName
()
+
'/'
)}
BaseTemplateItem
.
remove
(
self
,
context
,
**
kw
)
...
...
@@ -4000,7 +4000,7 @@ class FilesystemToZodbTemplateItem(FilesystemDocumentTemplateItem,
if
method_name
==
'preinstall'
:
old_result
=
result
.
copy
()
for
k
,
v
in
old_result
.
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
old_result
):
# Magical way to have unique path (without duplicating the prefix
# neither) in case of not yet migrated property sheets available on
# preinstall list
...
...
@@ -4047,7 +4047,7 @@ class FilesystemToZodbTemplateItem(FilesystemDocumentTemplateItem,
"""
remove_object_dict
=
kw
.
get
(
'remove_object_dict'
,
{})
kw
[
'remove_object_dict'
]
=
{
self
.
_getPath
(
k
):
v
for
k
,
v
in
remove_object_dict
.
iteritems
(
)
for
k
,
v
in
six
.
iteritems
(
remove_object_dict
)
if
k
.
startswith
(
self
.
getTemplateTypeName
()
+
'/'
)}
ObjectTemplateItem
.
remove
(
self
,
context
,
**
kw
)
...
...
@@ -4858,7 +4858,7 @@ class MessageTranslationTemplateItem(BaseTemplateItem):
if
len
(
self
.
_objects
)
==
0
:
return
root_path
=
self
.
__class__
.
__name__
for
key
,
obj
in
s
elf
.
_objects
.
iteritems
(
):
for
key
,
obj
in
s
ix
.
iteritems
(
self
.
_objects
):
path
=
os
.
path
.
join
(
root_path
,
key
)
if
'/'
in
key
:
bta
.
addObject
(
obj
,
'translation'
,
ext
=
'.po'
,
path
=
path
)
...
...
@@ -5452,7 +5452,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
# get objects to remove
# do remove after because we may need backup object from installation
remove_object_dict
=
{}
for
path
,
action
in
object_to_update
.
iteritems
(
):
for
path
,
action
in
six
.
iteritems
(
object_to_update
):
if
action
in
(
'remove'
,
'save_and_remove'
):
remove_object_dict
[
path
]
=
action
...
...
@@ -7122,7 +7122,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
message
=
(
"The following component could not be imported: "
+
', '
.
join
([
"%s (%s)"
%
(
name
,
error
)
for
name
,
error
in
failed_import_dict
.
iteritems
(
)
]))
for
name
,
error
in
six
.
iteritems
(
failed_import_dict
)
]))
if
list_selection_name
is
not
None
:
return
self
.
Base_redirect
(
'view'
,
...
...
product/ERP5/Document/Resource.py
View file @
c11e08ba
...
...
@@ -945,7 +945,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
uid
=
self
.
getUid
()
row_list
=
[]
for
unit_uid
,
value
in
s
elf
.
_getQuantityUnitDefinitionDict
().
iteritems
(
):
for
unit_uid
,
value
in
s
ix
.
iteritems
(
self
.
_getQuantityUnitDefinitionDict
()
):
definition_uid
,
quantity
=
value
row_list
.
append
(
dict
(
uid
=
definition_uid
,
resource_uid
=
uid
,
...
...
@@ -977,7 +977,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
metric_type_map
[
metric_type
]
=
measure
insert_list
=
[]
for
measure
in
metric_type_map
.
itervalues
(
):
for
measure
in
six
.
itervalues
(
metric_type_map
):
if
measure
is
not
None
:
insert_list
+=
measure
.
asCatalogRowList
(
quantity_unit_definition_dict
)
...
...
product/ERP5/ERP5Site.py
View file @
c11e08ba
...
...
@@ -2492,7 +2492,7 @@ def initialize(self):
REQUEST
.
RESPONSE
.
unauthorized
()
newSecurityManager
(
None
,
user
.
__of__
(
uf
))
manage_addERP5Site
(
app
.
__of__
(
RequestContainer
(
REQUEST
=
REQUEST
)),
**
{
k
:
kw
.
get
(
k
,
v
)
for
k
,
v
in
default_kw
.
iteritems
(
)
**
{
k
:
kw
.
get
(
k
,
v
)
for
k
,
v
in
six
.
iteritems
(
default_kw
)
if
isinstance
(
v
,
str
)})
transaction
.
get
().
note
(
'Created '
+
meta_type
)
transaction
.
commit
()
...
...
product/ERP5/Extensions/Diff.py
View file @
c11e08ba
...
...
@@ -70,7 +70,7 @@ def diff_objects(object_a, object_b):
for
property_dict_id
in
(
'values'
,
'tales'
,
'overrides'
):
a_property_dict
=
getattr
(
field_a
,
property_dict_id
)
b_property_dict
=
getattr
(
field_b
,
property_dict_id
)
for
property_id
,
a_property_value
in
a_property_dict
.
iteritems
(
):
for
property_id
,
a_property_value
in
six
.
iteritems
(
a_property_dict
):
b_property_value
=
b_property_dict
[
property_id
]
if
a_property_value
!=
b_property_value
:
if
isinstance
(
a_property_value
,
str
)
and
isinstance
(
b_property_value
,
str
):
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Amount.py
View file @
c11e08ba
...
...
@@ -121,7 +121,7 @@ class Amount(Base, VariatedMixin):
render_category_list
=
Renderer
(
display_id
=
display_id
,
**
kw
).
render
kw
[
'display_id'
]
=
'title'
for
base_category
,
(
object_list
,
category_list
)
in
variation_dict
.
iteritems
(
):
category_list
)
in
six
.
iteritems
(
variation_dict
):
if
base_category_list
and
base_category
not
in
base_category_list
:
continue
variation_category_item_list
+=
render_category_list
(
category_list
)
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.AppliedRule.py
View file @
c11e08ba
...
...
@@ -230,7 +230,7 @@ class AppliedRule(XMLObject, ExplainableMixin):
sm_dict
=
old_dict
.
setdefault
(
line
,
{})
recurse_list
=
deque
(({
get_matching_key
(
sm
):
(
sm
,)},))
while
recurse_list
:
for
k
,
x
in
recurse_list
.
popleft
().
iteritems
(
):
for
k
,
x
in
six
.
iteritems
(
recurse_list
.
popleft
()
):
if
not
k
:
continue
if
len
(
x
)
>
1
:
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.BusinessProcess.py
View file @
c11e08ba
...
...
@@ -869,7 +869,7 @@ class BusinessProcess(Path, XMLObject):
if
trade_phase_list
:
# reduce graph
next_dict
=
defaultdict
(
set
)
# build {phase: next_set} (i.e. reverse result)
for
next_
,
phase_set
in
result
.
iteritems
(
):
for
next_
,
phase_set
in
six
.
iteritems
(
result
):
for
phase
in
phase_set
:
next_dict
[
phase
].
add
(
next_
)
# for each phase to remove
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ContributionPredicate.py
View file @
c11e08ba
...
...
@@ -73,9 +73,9 @@ class ContributionPredicate(Predicate, XMLObject):
if
getattr
(
aq_base
(
self
),
'_identity_criterion'
,
None
)
is
None
:
self
.
_identity_criterion
=
{}
self
.
_range_criterion
=
{}
for
property_
,
value
in
s
elf
.
_identity_criterion
.
iteritems
(
):
for
property_
,
value
in
s
ix
.
iteritems
(
self
.
_identity_criterion
):
result
=
result
and
(
context
.
getProperty
(
property_
)
in
value
)
for
property_
,
(
min_
,
max_
)
in
s
elf
.
_range_criterion
.
iteritems
(
):
for
property_
,
(
min_
,
max_
)
in
s
ix
.
iteritems
(
self
.
_range_criterion
):
value
=
context
.
getProperty
(
property_
)
if
min_
is
not
None
:
result
=
result
and
(
value
>=
min_
)
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.SimulationMovement.py
View file @
c11e08ba
...
...
@@ -673,7 +673,7 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
path_set_to_check):
yield d
for id_, t in
tree_node.visited_movement_dict.iteritems(
):
for id_, t in
six.iteritems(tree_node.visited_movement_dict
):
subdocument, path = t
to_check = path_set_to_check
# do we need to change/copy the set?
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
View file @
c11e08ba
...
...
@@ -415,7 +415,7 @@ class AmountGeneratorMixin:
del
cell_aggregate
[
self_key
]
# Allow base_application & base_contribution to be variated.
for
property_dict
in
cell_aggregate
.
itervalues
(
):
for
property_dict
in
six
.
itervalues
(
cell_aggregate
):
base_amount_set
=
property_dict
[
'base_application_set'
]
variation_list
=
tuple
(
sorted
(
x
for
x
in
base_amount_set
if
not
x
.
startswith
(
'base_amount/'
)))
...
...
@@ -481,7 +481,7 @@ class AmountGeneratorMixin:
amount
.
_setQuantity
(
quantity
)
amount
.
_setTitle
(
self
.
getTitle
())
amount
.
_setDescription
(
self
.
getDescription
())
for
x
in
property_dict
.
iteritems
(
):
for
x
in
six
.
iteritems
(
property_dict
):
amount
.
_setProperty
(
*
x
)
# convert to default management unit if possible
amount
.
_setQuantity
(
amount
.
getConvertedQuantity
())
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin.py
View file @
c11e08ba
...
...
@@ -164,7 +164,7 @@ class DiscoverableMixin(CachedConvertableMixin):
else
:
result
=
method
()
if
result
is
not
None
:
for
key
,
value
in
result
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
result
):
if
value
not
in
(
None
,
''
):
kw
[
key
]
=
value
# Prepare the content edit parameters
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.GeneratedAmountList.py
View file @
c11e08ba
...
...
@@ -87,7 +87,7 @@ class GeneratedAmountList(list):
else
:
aggregate
[
1
]
+=
amount
.
getQuantity
()
from
erp5.component.document.RoundingModel
import
RoundingProxy
for
amount
,
quantity
in
aggregate_dict
.
itervalues
(
):
for
amount
,
quantity
in
six
.
itervalues
(
aggregate_dict
):
# Before we ignore 'quantity==0' amount here for better performance,
# but it is not a good idea, especially when the first expand causes
# non-zero quantity and then quantity becomes zero.
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.WebDAVSupport.py
View file @
c11e08ba
...
...
@@ -61,7 +61,7 @@ class TextContent:
title
=
tree
.
find
(
"head/title"
)
if
title
is
not
None
:
headers
[
"title"
]
=
title
.
text
return
{
k
:
v
if
len
(
v
)
>
1
else
v
[
0
]
for
k
,
v
in
headers
.
iteritems
(
)}
return
{
k
:
v
if
len
(
v
)
>
1
else
v
[
0
]
for
k
,
v
in
six
.
iteritems
(
headers
)}
## FTP handlers
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'PUT'
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py
View file @
c11e08ba
...
...
@@ -61,7 +61,7 @@ if detailed_report_result:
REQUEST
.
RESPONSE
.
setStatus
(
200
,
'OK'
,
lock
=
True
)
raise
Exception
(
'Spreadsheet contains errors'
)
for
base_category
,
category_list
in
category_list_spreadsheet_dict
.
iteritems
(
):
for
base_category
,
category_list
in
six
.
iteritems
(
category_list_spreadsheet_dict
):
total_category_counter
+=
len
(
category_list
)
category_path_set
=
set
()
for
category
in
category_list
:
...
...
@@ -108,7 +108,7 @@ for base_category, category_list in category_list_spreadsheet_dict.iteritems():
category_path_set
.
add
(
category_value
.
getRelativeUrl
())
category_update_dict
=
{}
for
key
,
value
in
category
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
category
):
if
not
create_local_property
and
key
not
in
category_type_property_id_set
:
report
(
field_type
=
'Update'
,
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.RuleTool.py
View file @
c11e08ba
...
...
@@ -143,7 +143,7 @@ class RuleTool(BaseTool):
for
m
in
message_list
:
expandable_dict
[
m
.
object
].
append
(
m
)
try
:
for
expandable
,
message_list
in
expandable_dict
.
iteritems
(
):
for
expandable
,
message_list
in
six
.
iteritems
(
expandable_dict
):
kw
=
{}
for
m
in
message_list
:
kw
.
update
(
m
.
kw
)
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
View file @
c11e08ba
...
...
@@ -436,15 +436,14 @@ class SimulationTool(BaseTool):
# Column values
column_value_dict
=
new_kw
.
pop
(
'column_value_dict'
,
{})
for
key
,
value
in
column_value_dict
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
column_value_dict
):
new_kw
[
'%s.%s'
%
(
table
,
key
)]
=
value
# Related keys
# First, the passthrough (acts as default values)
for
key
,
value
in
new_kw
.
pop
(
'related_key_dict_passthrough'
,
{})
\
.
iteritems
():
for
key
,
value
in
new_kw
.
pop
(
'related_key_dict_passthrough'
,
six
.
iteritems
({})):
new_kw
[
key
]
=
value
# Second, calculated values
for
key
,
value
in
new_kw
.
pop
(
'related_key_dict'
,
{}).
iteritems
(
):
for
key
,
value
in
new_kw
.
pop
(
'related_key_dict'
,
six
.
iteritems
({})
):
new_kw
[
'%s_%s'
%
(
table
,
key
)]
=
value
# Simulation states matched with input and output omission
def
getSimulationQuery
(
simulation_dict
,
omit_dict
):
...
...
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeTranslationQuery.py
View file @
c11e08ba
...
...
@@ -27,7 +27,7 @@ query_list = [
),
logical_operator
=
'and'
,
)
for
original_message
,
portal_type_set
in
original_message_dict
.
iteritems
(
)
for
original_message
,
portal_type_set
in
six
.
iteritems
(
original_message_dict
)
]
if
len
(
query_list
)
==
1
:
return
query_list
[
0
]
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.py
View file @
c11e08ba
...
...
@@ -41,7 +41,7 @@ for f in form.get_fields():
listbox
=
request
.
get
(
'listbox'
)
# XXX: hardcoded field name
if
listbox
is
not
None
:
listbox_line_list
=
[]
for
key
,
value
in
s
orted
(
listbox
.
iteritems
(
)):
for
key
,
value
in
s
ix
.
iteritems
(
sorted
(
listbox
)):
value
[
'listbox_key'
]
=
key
listbox_line_list
.
append
(
value
)
doaction_param_list
[
'listbox'
]
=
tuple
(
listbox_line_list
)
...
...
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
View file @
c11e08ba
...
...
@@ -159,7 +159,7 @@ class TestBusinessTemplateTwoFileExport(ERP5TypeTestCase):
test_page
=
self
.
portal
.
portal_components
[
test_component_id
]
for
property_id
,
property_value
in
test_component_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
test_component_kw
):
self
.
assertEqual
(
test_page
.
getProperty
(
property_id
),
property_value
)
def
test_twoFileImportExportForWebPage
(
self
):
...
...
@@ -211,7 +211,7 @@ class TestBusinessTemplateTwoFileExport(ERP5TypeTestCase):
(
js_file_id
,
js_document_kw
),
(
css_file_id
,
css_document_kw
)]:
web_page
=
self
.
portal
.
web_page_module
[
web_file
[
0
]]
for
property_id
,
property_value
in
web_file
[
1
].
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
web_file
[
1
]
):
self
.
assertEqual
(
web_page
.
getProperty
(
property_id
),
property_value
)
def
test_twoFileImportExportForPythonScript
(
self
):
...
...
@@ -275,7 +275,7 @@ class TestBusinessTemplateTwoFileExport(ERP5TypeTestCase):
import_template
.
install
()
image_page
=
self
.
portal
.
image_module
[
image_file_id
]
for
property_id
,
property_value
in
image_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
image_document_kw
):
self
.
assertEqual
(
image_page
.
getProperty
(
property_id
),
property_value
)
...
...
@@ -344,7 +344,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
file_page
=
self
.
portal
.
document_module
[
file_id
]
for
property_id
,
property_value
in
file_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
file_document_kw
):
self
.
assertEqual
(
getattr
(
file_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForFileIdentifyingTypeByContentTypeJS
(
self
):
...
...
@@ -515,7 +515,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
file_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
test_file_id
]
for
property_id
,
property_value
in
file_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
file_document_kw
):
self
.
assertEqual
(
getattr
(
file_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForPDF
(
self
):
...
...
@@ -570,7 +570,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
method_page
=
catalog
[
method_id
]
for
property_id
,
property_value
in
method_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
method_document_kw
):
self
.
assertEqual
(
getattr
(
method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForERP5SQLMethodInCatalog
(
self
):
...
...
@@ -618,7 +618,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
method_page
=
catalog
[
method_id
]
for
property_id
,
property_value
in
method_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
method_document_kw
):
self
.
assertEqual
(
getattr
(
method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForCatalogMethodInPortalSkins
(
self
):
...
...
@@ -664,7 +664,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
method_page
=
skin_folder
[
method_id
]
for
property_id
,
property_value
in
method_document_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
method_document_kw
):
self
.
assertEqual
(
getattr
(
method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForZopePageTemplate
(
self
):
...
...
@@ -703,7 +703,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
page_template_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
page_template_id
]
for
property_id
,
property_value
in
page_template_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
page_template_kw
):
self
.
assertEqual
(
getattr
(
page_template_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForDTMLMethodIdentifyingTypeByTitle
(
self
):
...
...
@@ -754,7 +754,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
dtml_method_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
dtml_method_id
]
for
property_id
,
property_value
in
dtml_method_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
dtml_method_kw
):
self
.
assertEqual
(
getattr
(
dtml_method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForDTMLMethodNotIdentifyingType
(
self
):
...
...
@@ -805,7 +805,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
dtml_method_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
dtml_method_id
]
for
property_id
,
property_value
in
dtml_method_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
dtml_method_kw
):
self
.
assertEqual
(
getattr
(
dtml_method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForOOoTemplate
(
self
):
...
...
@@ -850,7 +850,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
OOo_template_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
OOo_template_id
]
for
property_id
,
property_value
in
OOo_template_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
OOo_template_kw
):
self
.
assertEqual
(
getattr
(
OOo_template_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForSpreadsheetNotIdentifyingType
(
self
):
...
...
@@ -917,7 +917,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
test_page
=
self
.
portal
.
test_page_module
[
test_page_id
]
for
property_id
,
property_value
in
test_page_data_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
test_page_data_kw
):
self
.
assertEqual
(
getattr
(
test_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForERP5PythonScript
(
self
):
...
...
@@ -961,7 +961,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
python_script_page
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
python_script_id
]
for
property_id
,
property_value
in
python_script_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
python_script_kw
):
self
.
assertEqual
(
getattr
(
python_script_page
,
property_id
),
property_value
)
def
test_templateFolderIsCleanedUpInImportAndReexport
(
self
):
...
...
@@ -1129,7 +1129,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
# check that the page template has the expected attributes
# but the installed version encoding is utf-8
page_template
=
self
.
portal
.
portal_skins
[
skin_folder_id
][
page_template_id
]
for
property_id
,
property_value
in
page_template_kw
.
iteritems
(
):
for
property_id
,
property_value
in
six
.
iteritems
(
page_template_kw
):
self
.
assertEqual
(
getattr
(
page_template
,
property_id
),
property_value
)
# uninstall and export the business template
...
...
product/ERP5/tests/testInventoryAPI.py
View file @
c11e08ba
...
...
@@ -1593,7 +1593,7 @@ class TestInventoryList(InventoryAPITestCase):
resource_uid
=
resource
.
getUid
()
# create all movements
for
month
,
value
in
data
.
iteritems
(
):
for
month
,
value
in
six
.
iteritems
(
data
):
for
mov
in
value
[
'movement_list'
]:
d
=
DateTime
(
'%s/15 15:00 UTC'
%
month
)
self
.
_makeMovement
(
start_date
=
d
,
resource_uid
=
resource_uid
,
**
mov
)
...
...
@@ -1618,7 +1618,7 @@ class TestInventoryList(InventoryAPITestCase):
'2011/01'
:
dict
(
movement_list
=
[
h
(
22
,
8910
)],
after
=
h
(
291
,
133344
)),
}
for
month
,
value
in
internal_data
.
iteritems
(
):
for
month
,
value
in
six
.
iteritems
(
internal_data
):
for
mov
in
value
[
'movement_list'
]:
d
=
DateTime
(
'%s/15 15:00 UTC'
%
month
)
self
.
_makeMovement
(
is_internal
=
1
,
start_date
=
d
,
resource_uid
=
resource_uid
,
**
mov
)
...
...
@@ -2764,8 +2764,8 @@ class TestTrackingList(InventoryAPITestCase):
node_1_uid
:
1
,
node_2_uid
:
2
}
for
date
,
location_dict
in
date_location_dict
.
iteritems
(
):
for
param_id
,
location_uid
in
location_dict
.
iteritems
(
):
for
date
,
location_dict
in
six
.
iteritems
(
date_location_dict
):
for
param_id
,
location_uid
in
six
.
iteritems
(
location_dict
):
param_dict
=
{
param_id
:
date
}
uid_list
=
[
x
.
node_uid
for
x
in
getTrackingList
(
aggregate_uid
=
self
.
item
.
getUid
(),
**
param_dict
)]
...
...
@@ -2945,7 +2945,7 @@ class TestInventoryCacheTable(InventoryAPITestCase):
True: all values from criterion_dict match given inventory_line.
False otherwise.
"""
for
criterion_id
,
criterion_value
in
criterion_dict
.
iteritems
(
):
for
criterion_id
,
criterion_value
in
six
.
iteritems
(
criterion_dict
):
if
criterion_id
not
in
inventory_line
\
or
criterion_value
!=
inventory_line
[
criterion_id
]:
return
False
...
...
@@ -3733,7 +3733,7 @@ class BaseTestUnitConversion(InventoryAPITestCase):
def
setUpUnitDefinition
(
self
):
unit_module
=
self
.
portal
.
quantity_unit_conversion_module
for
base
,
t
in
s
elf
.
QUANTITY_UNIT_DICT
.
iteritems
(
):
for
base
,
t
in
s
ix
.
iteritems
(
self
.
QUANTITY_UNIT_DICT
):
standard
,
definition_dict
=
t
group
=
unit_module
.
_getOb
(
base
,
None
)
...
...
@@ -3745,7 +3745,7 @@ class BaseTestUnitConversion(InventoryAPITestCase):
if
group
.
getValidationState
()
in
(
'draft'
,
'invalidated'
):
group
.
validate
()
for
unit
,
amount
in
definition_dict
.
iteritems
(
):
for
unit
,
amount
in
six
.
iteritems
(
definition_dict
):
definition
=
group
.
_getOb
(
unit
,
None
)
if
definition
is
None
:
definition
=
group
.
newContent
(
...
...
@@ -3776,7 +3776,7 @@ class BaseTestUnitConversion(InventoryAPITestCase):
def
getNeededCategoryList
(
self
):
category_list
=
[
'metric_type/'
+
c
for
c
in
self
.
METRIC_TYPE_CATEGORY_LIST
]
for
base
,
t
in
s
elf
.
QUANTITY_UNIT_DICT
.
iteritems
(
):
for
base
,
t
in
s
ix
.
iteritems
(
self
.
QUANTITY_UNIT_DICT
):
standard
,
definition_dict
=
t
quantity
=
'quantity_unit/%s/'
%
base
...
...
product/ERP5/tests/testSpellChecking.py
View file @
c11e08ba
...
...
@@ -113,8 +113,8 @@ class TestSpellChecking(ERP5TypeTestCase):
"""
message
=
'"%s" is misspelled, suggestion are : "%s"'
result_dict
=
{}
for
word
,
result_list
in
s
elf
.
spellChecker
(
sentence
).
iteritems
(
):
filtered_result_list
=
filter
(
lambda
x
:
x
not
in
(
'*'
,
''
),
result_list
)
for
word
,
result_list
in
s
ix
.
iteritems
(
self
.
spellChecker
(
sentence
)
):
filtered_result_list
=
[
x
for
x
in
result_list
if
x
not
in
(
'*'
,
''
)]
if
filtered_result_list
:
result_dict
[
word
]
=
message
%
(
word
,
\
filtered_result_list
[
0
].
split
(
':'
)[
-
1
].
strip
())
...
...
product/ERP5/tests/utils.py
View file @
c11e08ba
...
...
@@ -109,7 +109,7 @@ class BusinessTemplateInfoBase:
def
parse
(
file_path
):
action_information
=
importXML
(
connection
,
file_path
)
action_information
.
__repr__
()
for
key
,
value
in
action_information
.
__dict__
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
action_information
.
__dict__
):
if
value
not
in
(
None
,
""
)
and
key
in
(
'action'
,
'condition'
)
:
setattr
(
action_information
,
key
,
value
.
text
)
actions
=
action_information
.
__dict__
.
copy
()
...
...
product/ERP5Catalog/CatalogTool.py
View file @
c11e08ba
...
...
@@ -112,7 +112,7 @@ class IndexableObjectWrapper(object):
skip_role_set
=
set
()
skip_role
=
skip_role_set
.
add
clear_skip_role
=
skip_role_set
.
clear
for
group_id
,
role_list
in
mergedLocalRoles
(
ob
).
iteritems
(
):
for
group_id
,
role_list
in
six
.
iteritems
(
mergedLocalRoles
(
ob
)
):
new_role_list
=
[]
new_role
=
new_role_list
.
append
clear_skip_role
()
...
...
@@ -142,7 +142,7 @@ class IndexableObjectWrapper(object):
no_indexable_role
=
self
.
__catalog_role_set
.
isdisjoint
return
(
group_id
for
group_id
,
role_list
in
s
elf
.
__getLocalRoleDict
().
iteritems
(
)
for
group_id
,
role_list
in
s
ix
.
iteritems
(
self
.
__getLocalRoleDict
()
)
if
group_id
not
in
self
.
__user_set
and
# group_id is returned only if any of its roles is indexable
not
no_indexable_role
(
role_list
)
...
...
@@ -197,7 +197,7 @@ class IndexableObjectWrapper(object):
''
:
allowed_role_set
,
}
optimized_role_set
=
set
()
for
role_definition_group
,
user_and_role_list
in
local_roles_group_id_dict
.
iteritems
(
):
for
role_definition_group
,
user_and_role_list
in
six
.
iteritems
(
local_roles_group_id_dict
):
group_allowed_set
=
allowed_by_local_roles_group_id
.
setdefault
(
role_definition_group
,
set
(),
...
...
@@ -212,7 +212,7 @@ class IndexableObjectWrapper(object):
user_view_permission_role_dict
=
{}
catalog_role_set
=
self
.
__catalog_role_set
user_set
=
self
.
__user_set
for
group_id
,
role_list
in
s
elf
.
__getLocalRoleDict
().
iteritems
(
):
for
group_id
,
role_list
in
s
ix
.
iteritems
(
self
.
__getLocalRoleDict
()
):
# Warning: only valid when group_id is candidate for indexation in a
# catalog_role column !
group_id_is_user
=
group_id
in
user_set
...
...
@@ -239,7 +239,7 @@ class IndexableObjectWrapper(object):
group_allowed_set
.
add
(
prefix
+
':'
+
role
)
# sort and freeze `allowed` principals
for
local_roles_group_id
,
allowed
in
allowed_by_local_roles_group_id
.
iteritems
(
):
for
local_roles_group_id
,
allowed
in
six
.
iteritems
(
allowed_by_local_roles_group_id
):
allowed_by_local_roles_group_id
[
local_roles_group_id
]
=
tuple
(
sorted
(
allowed
))
self
.
__security_parameter_cache
=
result
=
(
...
...
@@ -758,11 +758,11 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
)
query_list
=
[]
append
=
query_list
.
append
for
key
,
value
in
role_column_dict
.
iteritems
(
):
for
key
,
value
in
six
.
iteritems
(
role_column_dict
):
append
(
SimpleQuery
(
**
{
key
:
value
}))
if
security_uid_dict
:
catalog_security_uid_groups_columns_dict
=
self
.
getSQLCatalog
().
getSQLCatalogSecurityUidGroupsColumnsDict
()
for
local_roles_group_id
,
security_uid_list
in
s
ecurity_uid_dict
.
iteritems
(
):
for
local_roles_group_id
,
security_uid_list
in
s
ix
.
iteritems
(
security_uid_dict
):
assert
security_uid_list
append
(
SimpleQuery
(
**
{
catalog_security_uid_groups_columns_dict
[
local_roles_group_id
]:
security_uid_list
}
...
...
@@ -941,7 +941,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
security_uid_dict
,
w
.
optimised_roles_and_users
,
)
=
getSecurityUidDict
(
document_w
)
for
local_roles_group_id
,
security_uid
in
s
ecurity_uid_dict
.
iteritems
(
):
for
local_roles_group_id
,
security_uid
in
s
ix
.
iteritems
(
security_uid_dict
):
catalog_column
=
catalog_security_uid_groups_columns_dict
.
get
(
local_roles_group_id
,
default_security_uid_column
,
...
...
@@ -1207,7 +1207,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
suffix
=
(
''
if
forward
else
'__related'
)
+
'__uid'
parent_document_set
=
base_category_dict
.
pop
(
'parent'
,
None
)
query_list
=
[]
for
base_category_id
,
document_set
in
base_category_dict
.
iteritems
(
):
for
base_category_id
,
document_set
in
six
.
iteritems
(
base_category_dict
):
column
=
prefix
+
base_category_id
+
suffix
category_query
=
SimpleQuery
(
**
{
column
:
{
document
.
getUid
()
for
document
in
document_set
},
...
...
product/ERP5Catalog/Document/ERP5Catalog.py
View file @
c11e08ba
...
...
@@ -114,7 +114,7 @@ class FilterDict(object):
def
__setitem__
(
self
,
key
,
item
):
filter_
=
self
[
key
]
for
k
,
v
in
item
.
iteritems
(
):
for
k
,
v
in
six
.
iteritems
(
item
):
filter_
[
k
]
=
v
def
get
(
self
,
key
,
default
=
None
):
...
...
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