attr_ends_with

returns True if the attribute value ends with the given value.

Arguments

Source


def attr_ends_with(self, attr, value):
    a = self.attr(attr)
    if a is not None:
        ends = re.compile(value + '$')
        if ends.search(a) is not None:
            return True
    return False