'get the text of the label'

def get_text(self, lev, fmt):

    if isinstance(lev, six.string_types):
        return lev
    elif isinstance(fmt, dict):
        return fmt[lev]
    elif callable(fmt):
        return fmt(lev)
    else:
        return (fmt % lev)
