Skip to content
Snippets Groups Projects
Commit db02d260 authored by Seblu's avatar Seblu
Browse files

tag maching in tadisplay color

parent 66fa0f98
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment