Changeset 1910 in products for quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup
- Timestamp:
- Mar 15, 2010 4:24:07 PM (14 years ago)
- Location:
- quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/adapters.py
r1900 r1910 41 41 """ See interface. 42 42 """ 43 request = self.context.REQUEST44 43 meta_keywords = [] 45 filtered_keywords = []46 seo_context = queryMultiAdapter((self.context, request),name='seo_context')44 seo_context = queryMultiAdapter((self.context, self.context.REQUEST), 45 name='seo_context') 47 46 if seo_context: 48 47 meta_keywords = list(seo_context['meta_keywords']) … … 79 78 80 79 def canonical_path(self): 81 purl = getToolByName(self.context, 'portal_url')80 purl = getToolByName(self.context, 'portal_url') 82 81 83 82 # Calculate canonical path from qSEO_canonical property -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/interfaces.py
r955 r1910 11 11 12 12 def validateKeywords(text): 13 """ Parse text and validate each keyword (extracted from text) for appearing on the context page """ 13 """ Parse text and validate each keyword (extracted from text) 14 for appearing on the context page """ -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/keywords.py
r1885 r1910 30 30 url = '%s?without_metatag_keywords=1' % self.context.absolute_url() 31 31 32 # extract words from url page using lynx browser (test page by 'url' randered without metatag keywords) 32 # extract words from url page using lynx browser (test page by 'url' 33 # randered without metatag keywords) 33 34 page_text = commands.getoutput('lynx --dump --nolist %s' % url).lower() 34 35 if page_text and page_text != 'sh: lynx: command not found': -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/config.py
r1818 r1910 7 7 SHEET_TITLE = 'SEO Properties' 8 8 9 STOP_WORDS = ['a', 'an', 'amp', 'and', 'are', 'arial', 'as', 'at', 'be', 'but', 'by', 'can', 'com', 'do', 'font', 10 'for', 'from', 'gif', 'had', 'has', 'have', 'he', 'helvetica', 'her', 'his', 'how', 'href', 'i', 11 'if', 'in', 'is', 'it', 'javascript', 'jpg', 'made', 'net', 'of', 'on', 'or', 'org', 'our', 'sans', 12 'see', 'serif', 'she', 'that', 'the', 'this', 'to', 'us', 'we', 'with', 'you', 'your'] 9 STOP_WORDS = ['a', 'an', 'amp', 'and', 'are', 'arial', 'as', 'at', 'be', 'but', 10 'by', 'can', 'com', 'do', 'font', 'for', 'from', 'gif', 'had', 'has', 11 'have', 'he', 'helvetica', 'her', 'his', 'how', 'href', 'i', 'if', 'in', 12 'is', 'it', 'javascript', 'jpg', 'made', 'net', 'of', 'on', 'or', 'org', 13 'our', 'sans', 'see', 'serif', 'she', 'that', 'the', 'this', 'to', 'us', 14 'we', 'with', 'you', 'your'] 13 15 14 16 DEFAULT_CUSTOM_METATAGS = [] -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/setuphandlers.py
r1898 r1910 24 24 types_tool = getToolByName(site, 'portal_types') 25 25 for ptype in types_tool.objectValues(): 26 idxs = [idx_act[0] for idx_act in enumerate(ptype.listActions()) if idx_act[1].id == 'seo_properties'] 26 idxs = [idx_act[0] for idx_act in enumerate(ptype.listActions()) \ 27 if idx_act[1].id == 'seo_properties'] 27 28 if idxs: 28 29 ptype.deleteActions(idxs) -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/upgrades.py
r1850 r1910 10 10 11 11 def changeDomain(plone_tools): 12 """ Fix i18n_domain bug for some portal_types, which present in earlier versions of the package. 12 """ Fix i18n_domain bug for some portal_types, 13 which present in earlier versions of the package. 13 14 """ 14 15 types_tool = plone_tools.types() 15 for ptype in [ptypes for ptypes in types_tool.objectValues() if ptypes.id in FIX_PTYPES_DOMAIN]: 16 for ptype in [ptypes for ptypes in types_tool.objectValues() 17 if ptypes.id in FIX_PTYPES_DOMAIN]: 16 18 if ptype.i18n_domain == 'quintagroup.seoptimizer': 17 19 ptype.i18n_domain = 'plone' 18 logger.log(logging.INFO, "I18n Domain of the type \'%s\' changed to \'plone\'." % ptype.id) 20 logger.log(logging.INFO, "I18n Domain of the type \'%s\' " 21 "changed to \'plone\'." % ptype.id) 19 22 20 23 def changeMetatagsOrderList(plone_tools): … … 28 31 mto_new = [line.split(' ')[0].strip() for line in mto] 29 32 if not list(mto) == mto_new: 30 logger.log(logging.INFO, "Changed format metatags order list in configlet from \"metaname accessor\" to \"metaname\".") 33 logger.log(logging.INFO, "Changed format metatags order list in " 34 "configlet from \"metaname accessor\" to \"metaname\".") 31 35 seoprops_tool.manage_changeProperties(metatags_order=mto_new) 32 36 else: 33 setup_tool.runImportStepFromProfile('profile-quintagroup.seoptimizer:default', 'propertiestool') 37 setup_tool.runImportStepFromProfile('profile-quintagroup.seoptimizer:default', 38 'propertiestool') 34 39 35 40 36 41 def migrationActions(plone_tools): 37 """ Migration actions from portal_types action to seoproperties tool (for seoaction in portal_actions). 42 """ Migration actions from portal_types action to seoproperties tool 43 (for seoaction in portal_actions). 38 44 """ 39 45 types_tool = plone_tools.types() … … 42 48 flag = False 43 49 for ptype in types_tool.objectValues(): 44 idxs = [idx_act[0] for idx_act in enumerate(ptype.listActions()) if idx_act[1].id == 'seo_properties'] 50 idxs = [idx_act[0] for idx_act in enumerate(ptype.listActions()) 51 if idx_act[1].id == 'seo_properties'] 45 52 if idxs: 46 53 if ptype.id not in ctws: … … 48 55 flag = True 49 56 ptype.deleteActions(idxs) 50 logger.log(logging.INFO, "Moved \"SEO Properties\" action from %s type in portal actions." % ptype.id) 57 logger.log(logging.INFO, "Moved \"SEO Properties\" action from %s " 58 "type in portal actions." % ptype.id) 51 59 if flag: 52 60 seoprops_tool.manage_changeProperties(content_types_with_seoproperties=ctws) -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/util.py
r1673 r1910 6 6 from Globals import InitializeClass 7 7 8 def createMultiColumnList(self,slist, numCols, sort_on='title_or_id'):9 try:10 mcl = self.createMultiColumnList(slist, numCols, sort_on=sort_on)11 return mcl12 except AttributeError:13 return [slist]14 8 15 9 class SortedDict(dict):
Note: See TracChangeset
for help on using the changeset viewer.