py3: Replace basestring with six.string_types
Patch generated by the command: sixer.py basestring horizon/ openstack_dashboard/ tools/ Partial-Implements: blueprint porting-python3 Change-Id: I6fd251243a058457f69907eb1111f559a224e1cb
This commit is contained in:
parent
be746bca4e
commit
27e3f6c537
@ -15,6 +15,7 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
|
import six
|
||||||
|
|
||||||
from django.core.exceptions import ValidationError # noqa
|
from django.core.exceptions import ValidationError # noqa
|
||||||
from django.core import urlresolvers
|
from django.core import urlresolvers
|
||||||
@ -189,7 +190,7 @@ class SelectWidget(widgets.Select):
|
|||||||
html_attrs = self.transform_html_attrs(option_label)
|
html_attrs = self.transform_html_attrs(option_label)
|
||||||
other_html += flatatt(html_attrs)
|
other_html += flatatt(html_attrs)
|
||||||
|
|
||||||
if not isinstance(option_label, (basestring, Promise)):
|
if not isinstance(option_label, (six.string_types, Promise)):
|
||||||
for data_attr in self.data_attrs:
|
for data_attr in self.data_attrs:
|
||||||
data_value = html.conditional_escape(
|
data_value = html.conditional_escape(
|
||||||
force_text(getattr(option_label,
|
force_text(getattr(option_label,
|
||||||
|
@ -753,7 +753,7 @@ class BatchAction(Action):
|
|||||||
action_attr = getattr(self, "action_%s" % action_type)
|
action_attr = getattr(self, "action_%s" % action_type)
|
||||||
if self.use_action_method:
|
if self.use_action_method:
|
||||||
action_attr = action_attr(count)
|
action_attr = action_attr(count)
|
||||||
if isinstance(action_attr, (basestring, Promise)):
|
if isinstance(action_attr, (six.string_types, Promise)):
|
||||||
action = action_attr
|
action = action_attr
|
||||||
else:
|
else:
|
||||||
toggle_selection = getattr(self, "current_%s_action" % action_type)
|
toggle_selection = getattr(self, "current_%s_action" % action_type)
|
||||||
|
@ -318,7 +318,7 @@ class Step(object):
|
|||||||
# If it's callable we know the function exists and is valid
|
# If it's callable we know the function exists and is valid
|
||||||
self._handlers[key].append(possible_handler)
|
self._handlers[key].append(possible_handler)
|
||||||
continue
|
continue
|
||||||
elif not isinstance(possible_handler, basestring):
|
elif not isinstance(possible_handler, six.string_types):
|
||||||
raise TypeError("Connection handlers must be either "
|
raise TypeError("Connection handlers must be either "
|
||||||
"callables or strings.")
|
"callables or strings.")
|
||||||
bits = possible_handler.split(".")
|
bits = possible_handler.split(".")
|
||||||
|
@ -136,7 +136,7 @@ def resource_to_url(resource):
|
|||||||
def stack_output(output):
|
def stack_output(output):
|
||||||
if not output:
|
if not output:
|
||||||
return u''
|
return u''
|
||||||
if isinstance(output, basestring):
|
if isinstance(output, six.string_types):
|
||||||
parts = urlparse.urlsplit(output)
|
parts = urlparse.urlsplit(output)
|
||||||
if parts.netloc and parts.scheme in ('http', 'https'):
|
if parts.netloc and parts.scheme in ('http', 'https'):
|
||||||
url = html.escape(output)
|
url = html.escape(output)
|
||||||
|
Loading…
Reference in New Issue
Block a user