Commit 5fe67cf7 authored by Rafael Monnerat's avatar Rafael Monnerat

Py3: Use six.iteritems

parent 2ba60d56
Pipeline #38263 failed with stage
in 0 seconds
import six
portal = context.getPortalObject() portal = context.getPortalObject()
slapos_plugin_dict = { slapos_plugin_dict = {
'IExtractionPlugin': [ 'IExtractionPlugin': [
...@@ -23,7 +24,7 @@ def mergePASDictDifference(portal, d, fixit): ...@@ -23,7 +24,7 @@ def mergePASDictDifference(portal, d, fixit):
plugins = portal.acl_users.plugins plugins = portal.acl_users.plugins
plugin_type_info = plugins.listPluginTypeInfo() plugin_type_info = plugins.listPluginTypeInfo()
error_list = [] error_list = []
for plugin, active_list in d.iteritems(): for plugin, active_list in six.iteritems(d):
plugin_info = [q for q in plugin_type_info if q['id'] == plugin][0] plugin_info = [q for q in plugin_type_info if q['id'] == plugin][0]
found_list = plugins.listPlugins(plugin_info['interface']) found_list = plugins.listPlugins(plugin_info['interface'])
meta_type_list = [q[1].meta_type for q in found_list] meta_type_list = [q[1].meta_type for q in found_list]
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
############################################################################## ##############################################################################
import unittest import unittest
import six
from Products.ERP5Type.tests.CodingStyleTestCase import CodingStyleTestCase from Products.ERP5Type.tests.CodingStyleTestCase import CodingStyleTestCase
from Products.ERP5Type import CodingStyle from Products.ERP5Type import CodingStyle
...@@ -372,7 +373,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template): ...@@ -372,7 +373,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
if skin_id in skin_id_list: if skin_id in skin_id_list:
try: try:
document = self.portal.portal_skins[skin_id][document_id] document = self.portal.portal_skins[skin_id][document_id]
for _, content in content_dict.iteritems(): for _, content in six.iteritems(content_dict):
if document.getId() in content: if document.getId() in content:
message_list.append(skin_path) message_list.append(skin_path)
break break
...@@ -412,7 +413,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template): ...@@ -412,7 +413,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
continue continue
found = 0 found = 0
for _, content in content_dict.iteritems(): for _, content in six.iteritems(content_dict):
if document.getId() in content: if document.getId() in content:
found = 1 found = 1
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment