Ignore:
Timestamp:
Jan 5, 2010 1:45:36 AM (14 years ago)
Author:
liebster
Message:

Added import steps installation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/setuphandlers.py

    r1515 r1516  
     1import logging 
    12from Products.CMFCore.utils import getToolByName 
     3 
     4logger = logging.getLogger('quintagroup.seoptimizer') 
     5 
     6 
     7def 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 
     18def 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) 
    225 
    326def removeSkin(self, layer): 
     
    1134        for l in original_path: 
    1235            if (l == layer) or (l.startswith(layer+'/')): 
     36                logger.log(logging.INFO, "Removed %s layer from %s skin." % (l, skinName)) 
    1337                continue 
    1438            new_path.append(l) 
     
    2650                acts = list(ptype.listActions()) 
    2751                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) 
    2853 
    2954def remove_configlets( context, conf_ids ): 
     
    3459        for id in conf_ids: 
    3560            configTool.unregisterConfiglet(id) 
     61            logger.log(logging.INFO, "Unregistered \"%s\" configlet." % id) 
    3662 
    3763def uninstall( context ): 
Note: See TracChangeset for help on using the changeset viewer.