'Returns true if other_template is a subset of this one.
The value for other_template may be another FlairTemplate, or a tuple
of (text, css_class). The latter case is treated like a FlairTemplate
that doesn\'t permit editable text.
For example, if self permits editable text, then this method will return
True as long as just the css_classes match. On the other hand, if self
doesn\'t permit editable text but other_template does, this method will
return False.'

def covers(self, other_template):

    if isinstance(other_template, FlairTemplate):
        text_editable = other_template.text_editable
        (text, css_class) = (other_template.text, other_template.css_class)
    else:
        text_editable = False
        (text, css_class) = other_template
    if (self.css_class != css_class):
        return False
    return (self.text_editable or ((not text_editable) and (self.text == text)))
