Ignore:
Timestamp:
Mar 15, 2010 4:24:07 PM (14 years ago)
Author:
mylan
Message:

#160: clarify code, some clean-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/upgrades.py

    r1850 r1910  
    1010 
    1111def 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. 
    1314    """ 
    1415    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]: 
    1618        if ptype.i18n_domain == 'quintagroup.seoptimizer': 
    1719            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) 
    1922 
    2023def changeMetatagsOrderList(plone_tools): 
     
    2831        mto_new = [line.split(' ')[0].strip() for line in mto] 
    2932        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\".") 
    3135            seoprops_tool.manage_changeProperties(metatags_order=mto_new) 
    3236    else: 
    33         setup_tool.runImportStepFromProfile('profile-quintagroup.seoptimizer:default', 'propertiestool') 
     37        setup_tool.runImportStepFromProfile('profile-quintagroup.seoptimizer:default', 
     38                                            'propertiestool') 
    3439 
    3540 
    3641def 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). 
    3844    """ 
    3945    types_tool = plone_tools.types() 
     
    4248    flag = False 
    4349    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'] 
    4552        if idxs: 
    4653            if ptype.id not in ctws: 
     
    4855                flag = True 
    4956            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) 
    5159    if flag: 
    5260        seoprops_tool.manage_changeProperties(content_types_with_seoproperties=ctws) 
Note: See TracChangeset for help on using the changeset viewer.