import logging
+import six
import lxml.etree as ET
from werkzeug.exceptions import MethodNotAllowed
def _fill_element_dict(el, data, as_attr=()):
for k, v in data.iteritems():
if k in as_attr:
- if not isinstance(v, basestring):
+ if not isinstance(v, six.string_types):
v = str(v)
el.set(k, v)
else:
el.text = "1"
else:
el.text = "0"
- elif isinstance(data, basestring):
+ elif isinstance(data, six.string_types):
el.text = data
elif isinstance(data, int):
el.text = str(data)
import logging
+import six
from werkzeug.routing import Map, Rule
from mediagoblin.tools.common import import_component
_log.debug('endpoint: {0} view_func: {1}'.format(endpoint, view_func))
# import the endpoint, or if it's already a callable, call that
- if isinstance(view_func, basestring):
+ if isinstance(view_func, six.string_types):
view_func = import_component(view_func)
rule.gmg_controller = view_func
'mock',
'itsdangerous',
'pytz',
+ 'six',
## This is optional!
# 'translitcodec',
## For now we're expecting that users will install this from