source: products/qSEOptimizer/branches/additional-keywords/adapters.py @ 1

Last change on this file since 1 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 709 bytes
Line 
1from zope.interface import implements
2from Products.CMFCore.utils import getToolByName
3from Products.qSEOptimizer.interfaces import IKeywords
4
5
6class AdditionalKeywords(object):
7    implements(IKeywords)
8
9    def __init__(self, context):
10        self.context = context
11
12    def listKeywords(self):
13        portal_props = getToolByName(self.context, 'portal_properties')
14        seo_props = getToolByName(portal_props, 'seo_properties')
15        original = set(self.context.qSEO_Keywords())
16        additional = set(seo_props.additional_keywords)
17        text = set(self.context.SearchableText().split())
18        keywords = list(additional.intersection(text).union(original))
19        return ', '.join(keywords)
Note: See TracBrowser for help on using the repository browser.