Back to index

plone3  3.1.7
Install.py
Go to the documentation of this file.
00001 """
00002 $Id: Install.py 6810 2006-08-27 14:11:30Z hannosch $
00003 """
00004 
00005 from cStringIO import StringIO
00006 from Products.CMFCore.utils import getToolByName
00007 from Products.Marshall import registry
00008 from Products.Marshall.config import TOOL_ID as tool_id
00009 
00010 add_registry = registry.manage_addRegistry
00011 
00012 def install_tool(self, out):
00013     tool = getToolByName(self, tool_id, None)
00014     if tool is not None:
00015         out.write('Registry was already installed.\n')
00016         return
00017     add_registry(self)
00018     out.write('Registry installed sucessfully.\n')
00019 
00020 def install(self, out=None):
00021     if out is None:
00022         out = StringIO()
00023 
00024     install_tool(self, out)
00025 
00026     return out.getvalue()