Commit 215ef5f6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Arnaud Fontaine

py3: import six.string_types as basestring (a17bb910).

Co-authored-by: Arnaud Fontaine's avatarArnaud Fontaine <arnaud.fontaine@nexedi.com>
parent 29e3ee98
Pipeline #35777 passed with stage
in 0 seconds
...@@ -38,6 +38,7 @@ from erp5.component.interface.IEncryptedPassword import IEncryptedPassword ...@@ -38,6 +38,7 @@ from erp5.component.interface.IEncryptedPassword import IEncryptedPassword
from Products.ERP5Type.Globals import PersistentMapping from Products.ERP5Type.Globals import PersistentMapping
from Products.CMFCore.utils import _checkPermission from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.exceptions import AccessControl_Unauthorized from Products.CMFCore.exceptions import AccessControl_Unauthorized
from six import string_types as basestring
@zope.interface.implementer(IEncryptedPassword,) @zope.interface.implementer(IEncryptedPassword,)
class EncryptedPasswordMixin(object): class EncryptedPasswordMixin(object):
......
...@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject ...@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
from erp5.component.mixin.ConfiguratorItemMixin import ConfiguratorItemMixin from erp5.component.mixin.ConfiguratorItemMixin import ConfiguratorItemMixin
from erp5.component.interface.IConfiguratorItem import IConfiguratorItem from erp5.component.interface.IConfiguratorItem import IConfiguratorItem
from six import string_types as basestring
@zope.interface.implementer(IConfiguratorItem) @zope.interface.implementer(IConfiguratorItem)
class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject): class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......
...@@ -41,6 +41,7 @@ from erp5.component.module.WorkingCopy import \ ...@@ -41,6 +41,7 @@ from erp5.component.module.WorkingCopy import \
WorkingCopy, Dir, File, selfcached, \ WorkingCopy, Dir, File, selfcached, \
NotAWorkingCopyError, NotVersionedError, VcsConflictError NotAWorkingCopyError, NotVersionedError, VcsConflictError
from erp5.component.module.SubversionClient import newSubversionClient from erp5.component.module.SubversionClient import newSubversionClient
from six import string_types as basestring
# XXX This does not work with concurrent processes/threads accessing the # XXX This does not work with concurrent processes/threads accessing the
# same working copy... # same working copy...
......
...@@ -41,6 +41,7 @@ from DateTime import DateTime ...@@ -41,6 +41,7 @@ from DateTime import DateTime
from ZTUtils import make_query from ZTUtils import make_query
from Products.ERP5.Document.BusinessTemplate import BusinessTemplateFolder from Products.ERP5.Document.BusinessTemplate import BusinessTemplateFolder
from Products.ERP5Type.Utils import simple_decorator from Products.ERP5Type.Utils import simple_decorator
from six import string_types as basestring
@simple_decorator @simple_decorator
def selfcached(func): def selfcached(func):
......
import json import json
from six import string_types as basestring
commit_dict = json.loads(commit_json) if commit_json is not None else { commit_dict = json.loads(commit_json) if commit_json is not None else {
'added': (), 'added': (),
......
...@@ -8,6 +8,7 @@ else: ...@@ -8,6 +8,7 @@ else:
print('<div style="color: black">') print('<div style="color: black">')
# XXX: ERP5VCS_doCreateJavaScriptStatus should send lists # XXX: ERP5VCS_doCreateJavaScriptStatus should send lists
from six import string_types as basestring
if isinstance(added, basestring): if isinstance(added, basestring):
added = added != 'none' and filter(None, added.split(',')) or () added = added != 'none' and filter(None, added.split(',')) or ()
if isinstance(modified, basestring): if isinstance(modified, basestring):
......
from six import string_types as basestring
toggable_pad = None toggable_pad = None
all_knowledge_pads = context.ERP5Site_getKnowledgePadListForUser(mode=mode) all_knowledge_pads = context.ERP5Site_getKnowledgePadListForUser(mode=mode)
if isinstance(knowledge_pad_url, basestring): if isinstance(knowledge_pad_url, basestring):
......
...@@ -361,7 +361,7 @@ class _ERP5AuthorisationEndpoint(AuthorizationEndpoint): ...@@ -361,7 +361,7 @@ class _ERP5AuthorisationEndpoint(AuthorizationEndpoint):
for key, value in six.iteritems(request_info_dict): for key, value in six.iteritems(request_info_dict):
if value is None: if value is None:
continue continue
if not isinstance(value, basestring): if not isinstance(value, six.string_types):
raise TypeError((key, repr(value))) raise TypeError((key, repr(value)))
new_request_info_dict[key] = value new_request_info_dict[key] = value
inner_response = HTTPResponse(stdout=None, stderr=None) inner_response = HTTPResponse(stdout=None, stderr=None)
...@@ -857,7 +857,7 @@ def _callEndpoint(endpoint, self, REQUEST): ...@@ -857,7 +857,7 @@ def _callEndpoint(endpoint, self, REQUEST):
request_body = urllib.urlencode([ request_body = urllib.urlencode([
(x, y) (x, y)
for x, y in six.iteritems(REQUEST.form) for x, y in six.iteritems(REQUEST.form)
if isinstance(y, basestring) if isinstance(y, six.string_types)
]) ])
uri = other.get('URL', '') uri = other.get('URL', '')
query_string = environ.get('QUERY_STRING') query_string = environ.get('QUERY_STRING')
......
...@@ -2,6 +2,7 @@ import difflib ...@@ -2,6 +2,7 @@ import difflib
import zipfile import zipfile
import os import os
import re import re
from six import string_types as basestring
from zExceptions import Unauthorized from zExceptions import Unauthorized
separator1 = '=' * 70 separator1 = '=' * 70
......
...@@ -35,6 +35,7 @@ from zLOG import LOG, INFO, WARNING ...@@ -35,6 +35,7 @@ from zLOG import LOG, INFO, WARNING
from erp5.component.module.ERP5Conduit import ERP5Conduit from erp5.component.module.ERP5Conduit import ERP5Conduit
from lxml import etree from lxml import etree
from copy import deepcopy from copy import deepcopy
from six import string_types as basestring
parser = etree.XMLParser(remove_blank_text=True) parser = etree.XMLParser(remove_blank_text=True)
XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before') XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before')
......
...@@ -38,6 +38,7 @@ from Products.ERP5Type import Permissions ...@@ -38,6 +38,7 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type.Timeout import Deadline, TimeoutReachedError from Products.ERP5Type.Timeout import Deadline, TimeoutReachedError
from Products.ERP5Type.UnrestrictedMethod import super_user from Products.ERP5Type.UnrestrictedMethod import super_user
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
from six import string_types as basestring
def isJson(header_dict): def isJson(header_dict):
return header_dict.get('content-type', '').split(';', 1)[0] == 'application/json' return header_dict.get('content-type', '').split(';', 1)[0] == 'application/json'
......
...@@ -5,6 +5,7 @@ from Products.ERP5Type.XMLObject import XMLObject ...@@ -5,6 +5,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
import random, string, hashlib, urllib2, socket import random, string, hashlib, urllib2, socket
from urlparse import urlparse from urlparse import urlparse
from six import string_types as basestring
try: try:
import xml.etree.cElementTree as ET import xml.etree.cElementTree as ET
except ImportError: except ImportError:
......
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