Changeset 1516 in products for quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/setuphandlers.py
- Timestamp:
- Jan 5, 2010 1:45:36 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/setuphandlers.py
r1515 r1516 1 import logging 1 2 from Products.CMFCore.utils import getToolByName 3 4 logger = logging.getLogger('quintagroup.seoptimizer') 5 6 7 def migrationActions(site): 8 old = 'qseo_properties_edit_form' 9 new = '@@seo-context-properties' 10 for ptype in site.portal_types.objectValues(): 11 acts = filter(lambda x: x.id == 'seo_properties' and old in x.getActionExpression(), ptype.listActions()) 12 for act in acts: 13 ac_exp = act.getActionExpression() 14 if old in ac_exp: 15 act.setActionExpression(ac_exp.replace(old, new)) 16 logger.log(logging.INFO, "For %s type changed URL Expression \"SEO Properties\" action's from %s to %s." % (ptype.id, old, new)) 17 18 def importVarious(context): 19 """ Do customized installation. 20 """ 21 if context.readDataFile('seo_install.txt') is None: 22 return 23 site = context.getSite() 24 migrationActions(site) 2 25 3 26 def removeSkin(self, layer): … … 11 34 for l in original_path: 12 35 if (l == layer) or (l.startswith(layer+'/')): 36 logger.log(logging.INFO, "Removed %s layer from %s skin." % (l, skinName)) 13 37 continue 14 38 new_path.append(l) … … 26 50 acts = list(ptype.listActions()) 27 51 ptype.deleteActions([acts.index(a) for a in acts if a.getId()=='seo_properties']) 52 logger.log(logging.INFO, "Deleted \"SEO Properties\" action for %s type." % ptype.id) 28 53 29 54 def remove_configlets( context, conf_ids ): … … 34 59 for id in conf_ids: 35 60 configTool.unregisterConfiglet(id) 61 logger.log(logging.INFO, "Unregistered \"%s\" configlet." % id) 36 62 37 63 def uninstall( context ):
Note: See TracChangeset
for help on using the changeset viewer.