Commit db02d260 authored by Seblu's avatar Seblu
Browse files

tag maching in tadisplay color

parent 66fa0f98
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -50,8 +50,14 @@ class TagDisplay(object):

    def color(self, tagname):
        '''Return the current tag color'''
        if tagname in self.tagcolor and self.tagcolor[tagname] in color:
            return color[self.tagcolor[tagname]]
        tagname = unicode(tagname)
        # build list of matching pattern with tagname
        l = [ x for x in self.tagcolor if fnmatch.fnmatch(tagname, x) ]
        if len(l) > 0:
            # select longest match
            tm = max(l)
            if self.tagcolor[tm] in color:
                return color[self.tagcolor[tm]]
        return color["yellow"]

    def resolve(self, tagname, tagvalue):