def __call__(self, context): assert self.key is not None if isinstance(context, dict): context = context.get('context', None) values = infolder_keywords(context, self.key) values = uniquify( [magicstring(a.strip()).decode('utf-8') for a in values]) values.sort() values = [ SimpleTerm(baseNormalize(category).strip(), baseNormalize(category).strip(), category) for category in uniquify(values)] return SimpleVocabulary(values)
def infolder_keywords(self, ctx=None, field='Subject'): """.""" if ctx is None: ctx = self.context return infolder_keywords(ctx, field=field)