[browser2] add a join filter

This commit is contained in:
Bezleputh 2014-03-22 19:15:36 +01:00 committed by Florent
commit d8887cf3d7
2 changed files with 20 additions and 16 deletions

View file

@ -323,3 +323,16 @@ class Format(MultiFilter):
def filter(self, values):
return self.fmt % values
class Join(CleanText):
def __init__(self, pattern, selector):
super(Join, self).__init__(selector)
self.pattern = pattern
def filter(self, el):
res = ''
for li in el:
res += self.pattern % self.clean(li)
return res