def is_class(self, style, accessorCacheBack=None): ac = accessorCacheBack if ac is not None: pcs = ac.getCurrentPosCharStyle() print " is_class:: pcs: %r" % (pcs, ) if self.is_operator(pcs[2]) and pcs[1] in ">.;}{": return True try: DEBUG = False # Check that the preceding character before the identifier is a "." ppcs = ac.getPrecedingPosCharStyle(pcs[2], ignore_styles=self.ignore_styles) if DEBUG: print " is_class:: ppcs: %r" % (ppcs, ) if ppcs[2] in self.identifier_styles: ppcs = ac.getPrecedingPosCharStyle(ppcs[2], ignore_styles=self.ignore_styles) if self.is_operator(ppcs[2]) and ppcs[1] == ".": return True elif not is_udl_css_style(ppcs[2]): return True # If there is no identifer, may be operator, which is okay elif not is_udl_css_style(ppcs[2]) or \ (self.is_operator(ppcs[2]) and ppcs[1] in "};"): return True if DEBUG: print " is_class:: Not a class style" finally: # Reset the accessor back to the current position ac.resetToPosition(pcs[0]) return False
def is_css_style(self, style, accessorCacheBack=None): return is_udl_css_style(style)