From ea530fe8a1f2390b25cec8d6c4b3e09734c00415 Mon Sep 17 00:00:00 2001 From: Seblu <sebastien.luttringer@smartjog.com> Date: Wed, 9 Feb 2011 11:45:36 +0100 Subject: [PATCH] tag glob in tagdisplay --- cccli/tagdisplay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cccli/tagdisplay.py b/cccli/tagdisplay.py index a00b3ad..9e1acd8 100644 --- a/cccli/tagdisplay.py +++ b/cccli/tagdisplay.py @@ -12,6 +12,7 @@ import re import math import ConfigParser import time +import fnmatch class TagDisplay(object): '''Handle tagdisplay stuff''' @@ -60,8 +61,9 @@ class TagDisplay(object): if bool(self.option.get("quotespace", False)): if re.search("\s", tagvalue) is not None: tagvalue = "'%s'"%re.sub("'", "\'", tagvalue) - if tagname in self.tagtype and self.tagtype[tagname] in self.types: - return getattr(self, "type_%s"%self.tagtype[tagname])(tagvalue) + l = [ x for x in self.tagtype if fnmatch.fnmatch(tagname, x) ] + if len(l) > 0 and self.tagtype[l[0]] in self.types: + return getattr(self, "type_%s"%self.tagtype[l[0]])(tagvalue) return tagvalue def type_lower(self, value): -- GitLab