vendor/CMF/1.6-r40908/CMFCalendar

view __init__.py @ 0:e47fc5876d9a

Vendor import of CMF 1.6 branch r40908
author fguillaume
date Tue, 20 Dec 2005 15:51:52 +0000
parents
children
line source
1 ##############################################################################
2 #
3 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
4 #
5 # This software is subject to the provisions of the Zope Public License,
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10 # FOR A PARTICULAR PURPOSE.
11 #
12 ##############################################################################
13 """ CMF Calendar product.
15 $Id: __init__.py 40635 2005-12-07 21:12:32Z tseaver $
16 """
18 import sys
20 from Products.CMFCore import utils
21 from Products.CMFCore.interfaces import ISiteRoot
22 from Products.CMFCore.DirectoryView import registerDirectory
23 from Products.GenericSetup import EXTENSION
24 from Products.GenericSetup import profile_registry
26 import Event
27 import CalendarTool
28 from permissions import AddPortalContent
31 this_module = sys.modules[ __name__ ]
33 contentConstructors = (Event.addEvent,)
34 contentClasses = (Event.Event,)
36 tools = ( CalendarTool.CalendarTool, )
38 z_bases = utils.initializeBasesPhase1( contentClasses, this_module )
40 # This is used by a script (external method) that can be run
41 # to set up Events in an existing CMF Site instance.
42 event_globals=globals()
44 # Make the skins available as DirectoryViews
45 registerDirectory('skins', globals())
47 def initialize( context ):
48 utils.ToolInit('CMF Calendar Tool', tools=tools, icon='tool.gif',
49 ).initialize( context )
51 utils.initializeBasesPhase2( z_bases, context )
52 utils.ContentInit( 'CMF Event'
53 , content_types = contentClasses
54 , permission = AddPortalContent
55 , extra_constructors = contentConstructors
56 , fti = Event.factory_type_information
57 ).initialize( context )
59 profile_registry.registerProfile('default',
60 'CMFCalendar',
61 'Adds calendar support.',
62 'profiles/default',
63 'CMFCalendar',
64 EXTENSION,
65 for_=ISiteRoot,
66 )