From 4f6f6848b6c80208ae170ef6f00f5fed3d068a8e Mon Sep 17 00:00:00 2001 From: Kyle MacFarlane Date: Sat, 11 Oct 2014 03:30:35 +0100 Subject: [PATCH] Replace basestring with six.string_types --- src/z3c/rml/paraparser.py | 3 ++- src/z3c/rml/template.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/z3c/rml/paraparser.py b/src/z3c/rml/paraparser.py index 2c90c16..c9a913b 100644 --- a/src/z3c/rml/paraparser.py +++ b/src/z3c/rml/paraparser.py @@ -15,6 +15,7 @@ """ import copy import inspect +import six import reportlab.lib.fonts import reportlab.platypus.paraparser @@ -86,7 +87,7 @@ def __init__(self, **attributes): def text(self): text = u'' for frag in self.frags: - if isinstance(frag, basestring): + if isinstance(frag, six.string_types): text += frag else: text += frag.text diff --git a/src/z3c/rml/template.py b/src/z3c/rml/template.py index 3d8a9ae..22c2a67 100644 --- a/src/z3c/rml/template.py +++ b/src/z3c/rml/template.py @@ -13,6 +13,7 @@ ############################################################################## """Style Related Element Processing """ +import six import zope.interface from reportlab import platypus from z3c.rml import attr, directive, interfaces, occurence @@ -122,7 +123,7 @@ def process(self): args = dict(self.getAttributeValues()) # Deal with percentages for name, dir in (('x1', 0), ('y1', 1), ('width', 0), ('height', 1)): - if isinstance(args[name], basestring) and args[name].endswith('%'): + if isinstance(args[name], six.string_types) and args[name].endswith('%'): args[name] = float(args[name][:-1])/100*size[dir] frame = platypus.Frame(**args) self.parent.frames.append(frame)