Changeset 3134 in products for quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/Extensions/Install.py
- Timestamp:
- Apr 18, 2011 2:32:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/Extensions/Install.py
r2139 r3134 11 11 UNINSTALL = 'profile-%s:uninstall' % PROJECT_NAME 12 12 13 13 14 def install(portal, reinstall=False): 14 15 """ (Re)Install this product. 15 16 16 This external method is need, because portal_quickinstaller doens't know17 what GenericProfile profile to apply when reinstalling a product.17 This external method is need, because portal_quickinstaller doens't 18 know what GenericProfile profile to apply when reinstalling a product. 18 19 """ 19 20 setup_tool = getToolByName(portal, 'portal_setup') … … 21 22 step = None 22 23 profile_id = 'quintagroup.seoptimizer:default' 23 steps_to_run = [s['id'] for s in setup_tool.listUpgrades(profile_id, show_old=False)] 24 steps_to_run = [s['id'] for s in \ 25 setup_tool.listUpgrades(profile_id, show_old=False)] 24 26 for step_id in steps_to_run: 25 27 step = _upgrade_registry.getUpgradeStep(profile_id, step_id) 26 28 step.doStep(setup_tool) 27 msg = "Ran upgrade step %s for profile %s" % (step.title, profile_id) 29 msg = "Ran upgrade step %s for profile %s" \ 30 % (step.title, profile_id) 28 31 logger.log(logging.INFO, msg) 29 32 # We update the profile version to the last one we have reached 30 33 # with running an upgrade step. 31 34 if step and step.dest is not None and step.checker is None: 32 setup_tool.setLastVersionForProfile(profile_id, step.dest)35 setup_tool.setLastVersionForProfile(profile_id, step.dest) 33 36 return "Ran all reinstall steps." 34 37 else: … … 36 39 return "Ran all install steps." 37 40 41 38 42 def uninstall(portal, reinstall=False): 39 43 """ Uninstall this product. 40 44 41 This external method is need, because portal_quickinstaller doens't know42 what GenericProfile profile to apply when uninstalling a product.45 This external method is need, because portal_quickinstaller doens't 46 know what GenericProfile profile to apply when uninstalling a product. 43 47 """ 44 48 setup_tool = getToolByName(portal, 'portal_setup')
Note: See TracChangeset
for help on using the changeset viewer.