Back to index

plone3  3.1.7
setuphandlers.py
Go to the documentation of this file.
00001 ## -*- coding: utf-8 -*-
00002 ## Copyright (C) 2008 Ingeniweb
00003 
00004 ## This program is free software; you can redistribute it and/or modify
00005 ## it under the terms of the GNU General Public License as published by
00006 ## the Free Software Foundation; either version 2 of the License, or
00007 ## (at your option) any later version.
00008 
00009 ## This program is distributed in the hope that it will be useful,
00010 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ## GNU General Public License for more details.
00013 
00014 ## You should have received a copy of the GNU General Public License
00015 ## along with this program; see the file COPYING. If not, write to the
00016 ## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 __version__ = "$Revision: $"
00019 # $Source: $
00020 # $Id: $
00021 __docformat__ = 'restructuredtext'
00022 
00023 from zope.interface import alsoProvides
00024 from Products.CMFCore.utils import getToolByName
00025 from Products.CMFPlacefulWorkflow.interfaces import IPlacefulMarker
00026 
00027 def installMarker(context):
00028     """
00029     Apply a marker interface to the workflow tool to indicate that the
00030     product is installed.
00031     """
00032     # Only run step if a flag file is present (e.g. not an extension profile)
00033     if context.readDataFile('placeful_marker.txt') is None:
00034         return
00035     site = context.getSite()
00036     wf = getToolByName(site, 'portal_workflow', None)
00037     if wf is not None:
00038         alsoProvides(wf, IPlacefulMarker)