[CMF-checkins] SVN: CMF/branches/tseaver-pkg_resources/ Clean up
product initialization:
Tres Seaver
tseaver at palladion.com
Thu Nov 10 17:06:19 EST 2005
Log message for revision 40040:
Clean up product initialization:
o Drop support for ZClasses (we can ship an add-on which supplies this,
if needed).
o Move all non-essential activity out of module scope and into the
'initialize'.
o Made the names of the aliases for 'globals()' consistent (note that this
may cause breakage).
Changed:
U CMF/branches/tseaver-pkg_resources/CMFActionIcons/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFCalendar/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFCore/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFDefault/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFSetup/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFTopic/__init__.py
U CMF/branches/tseaver-pkg_resources/CMFUid/__init__.py
U CMF/branches/tseaver-pkg_resources/DCWorkflow/__init__.py
U CMF/branches/tseaver-pkg_resources/GenericSetup/__init__.py
-=-
Modified: CMF/branches/tseaver-pkg_resources/CMFActionIcons/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFActionIcons/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFActionIcons/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -16,29 +16,28 @@
$Id$
"""
-from Products.CMFCore.DirectoryView import registerDirectory
-from Products.CMFCore.utils import ToolInit
-try:
- from Products.CMFSetup import EXTENSION
- from Products.CMFSetup import profile_registry
- has_profile_registry = True
-except ImportError:
- has_profile_registry = False
-import ActionIconsTool
+cmfactionicons_globals = globals()
-actionicons_globals = globals()
-
-if __name__.startswith('Products'): # testrunner may import w/o 'Products'
- registerDirectory('skins', actionicons_globals)
-
def initialize( context ):
+ from Products.CMFCore.DirectoryView import registerDirectory
+ from Products.CMFCore.utils import ToolInit
+ try:
+ from Products.CMFSetup import EXTENSION
+ from Products.CMFSetup import profile_registry
+ has_profile_registry = True
+ except ImportError:
+ has_profile_registry = False
+ import ActionIconsTool
+
ToolInit( meta_type='CMF Action Icons Tool'
, tools=( ActionIconsTool.ActionIconsTool, )
, icon="tool.gif"
).initialize( context )
+ registerDirectory('skins', cmfactionicons_globals)
+
if has_profile_registry:
profile_registry.registerProfile('actionicons',
'CMFActionIcons',
Modified: CMF/branches/tseaver-pkg_resources/CMFCalendar/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFCalendar/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFCalendar/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,52 +15,42 @@
$Id$
"""
-import sys
-
-import utils
-from Products.CMFCore import utils
-from Products.CMFCore.DirectoryView import registerDirectory
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
-
-import Event
-import CalendarTool
-from permissions import AddPortalContent
-
-
-this_module = sys.modules[ __name__ ]
-
-contentConstructors = (Event.addEvent,)
-contentClasses = (Event.Event,)
-
-tools = ( CalendarTool.CalendarTool, )
-
-z_bases = utils.initializeBasesPhase1( contentClasses, this_module )
-
# This is used by a script (external method) that can be run
# to set up Events in an existing CMF Site instance.
-event_globals=globals()
+cmfcalendar_globals = globals()
-# Make the skins available as DirectoryViews
-if __name__.startswith('Products'): # testrunner may import w/o 'Products'
- registerDirectory('skins', globals())
-
def initialize( context ):
- utils.ToolInit('CMF Calendar Tool', tools=tools, icon='tool.gif',
- ).initialize( context )
+ from Products.CMFCore.utils import ContentInit
+ from Products.CMFCore.utils import ToolInit
+ from Products.CMFCore.DirectoryView import registerDirectory
+ from Products.GenericSetup import EXTENSION
+ from Products.GenericSetup import profile_registry
- utils.initializeBasesPhase2( z_bases, context )
- context.registerHelpTitle('CMF Calendar Help')
- context.registerHelp(directory='help')
- utils.ContentInit( 'CMF Event'
- , content_types = contentClasses
- , permission = AddPortalContent
- , extra_constructors = contentConstructors
- ).initialize( context )
+ import Event
+ import CalendarTool
+ from permissions import AddPortalContent
+
+ tools = ( CalendarTool.CalendarTool, )
+ ToolInit( 'CMF Calendar Tool'
+ , tools=tools, icon='tool.gif'
+ ).initialize( context )
+
+ contentConstructors = (Event.addEvent,)
+ contentClasses = (Event.Event,)
+ ContentInit( 'CMF Event'
+ , content_types = contentClasses
+ , permission = AddPortalContent
+ , extra_constructors = contentConstructors
+ ).initialize( context )
+
profile_registry.registerProfile('default',
'CMFCalendar',
'Adds calendar support.',
'profiles/default',
'CMFCalendar',
EXTENSION)
+ registerDirectory('skins', cmfcalendar_globals)
+
+ context.registerHelpTitle('CMF Calendar Help')
+ context.registerHelp(directory='help')
Modified: CMF/branches/tseaver-pkg_resources/CMFCore/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFCore/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFCore/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,76 +15,12 @@
$Id$
"""
-from sys import modules
+cmfcore_globals = globals()
-import PortalObject, PortalContent, PortalFolder
-import MembershipTool, WorkflowTool, CatalogTool, DiscussionTool
-import ActionsTool, UndoTool, RegistrationTool, SkinsTool
-import MemberDataTool, TypesTool
-import URLTool
-import fiveactionstool
-import DirectoryView, FSImage, FSFile, FSPropertiesObject
-import FSDTMLMethod, FSPythonScript, FSSTXMethod
-import FSPageTemplate
-import FSZSQLMethod
-import ActionInformation
-import CookieCrumbler
-import ContentTypeRegistry
-import CachingPolicyManager
-import CMFBTreeFolder
-import utils
-
-from interfaces import IAction
-from interfaces import IActionCategory
-from interfaces import ITypeInformation
-from permissions import AddPortalFolders
-from permissions import ManagePortal
-
-
-bases = (
- PortalObject.PortalObjectBase,
- PortalFolder.PortalFolder,
- PortalContent.PortalContent,
- )
-
-tools = (
- MembershipTool.MembershipTool,
- RegistrationTool.RegistrationTool,
- WorkflowTool.WorkflowTool,
- CatalogTool.CatalogTool,
- DiscussionTool.DiscussionTool,
- ActionsTool.ActionsTool,
- UndoTool.UndoTool,
- SkinsTool.SkinsTool,
- MemberDataTool.MemberDataTool,
- TypesTool.TypesTool,
- URLTool.URLTool,
- fiveactionstool.FiveActionsTool,
- )
-
-this_module = modules[ __name__ ]
-
-z_bases = utils.initializeBasesPhase1(bases, this_module)
-z_tool_bases = utils.initializeBasesPhase1(tools, this_module)
-
-FolderConstructorForm = ( 'manage_addPortalFolderForm'
- , PortalFolder.manage_addPortalFolderForm
- )
-
-cmfcore_globals=globals()
-
-_CONTENT_TYPES = ( PortalFolder.PortalFolder
- , CMFBTreeFolder.CMFBTreeFolder
- )
-
-_EXTRA_CONSTRUCTORS = ( PortalFolder.manage_addPortalFolder
- , CMFBTreeFolder.manage_addCMFBTreeFolder
- )
-
-
# Because persistent objects may be out there which were
# created when the module was in that product, we need
# __module_aliases__ .
+import CMFBTreeFolder
__module_aliases__ = ( ( 'Products.BTreeFolder2.CMFBTreeFolder'
, 'Products.CMFCore.CMFBTreeFolder'
)
@@ -93,9 +29,70 @@
def initialize(context):
- utils.initializeBasesPhase2(z_bases, context)
- utils.initializeBasesPhase2(z_tool_bases, context)
+ import ActionInformation
+ import ActionsTool
+ import CachingPolicyManager
+ import CatalogTool
+ import ContentTypeRegistry
+ import CookieCrumbler
+ import DirectoryView
+ import DiscussionTool
+ import fiveactionstool
+ import FSDTMLMethod
+ import FSFile
+ import FSImage
+ import FSPageTemplate
+ import FSPropertiesObject
+ import FSPythonScript
+ import FSSTXMethod
+ import FSZSQLMethod
+ import MemberDataTool
+ import MembershipTool
+ import PortalContent
+ import PortalFolder
+ import PortalObject
+ import RegistrationTool
+ import SkinsTool
+ import TypesTool
+ import UndoTool
+ import URLTool
+ import utils
+ import WorkflowTool
+ from interfaces import IAction
+ from interfaces import IActionCategory
+ from interfaces import ITypeInformation
+ from permissions import AddPortalFolders
+ from permissions import ManagePortal
+
+
+ tools = (
+ MembershipTool.MembershipTool,
+ RegistrationTool.RegistrationTool,
+ WorkflowTool.WorkflowTool,
+ CatalogTool.CatalogTool,
+ DiscussionTool.DiscussionTool,
+ ActionsTool.ActionsTool,
+ UndoTool.UndoTool,
+ SkinsTool.SkinsTool,
+ MemberDataTool.MemberDataTool,
+ TypesTool.TypesTool,
+ URLTool.URLTool,
+ fiveactionstool.FiveActionsTool,
+ )
+
+ FolderConstructorForm = ( 'manage_addPortalFolderForm'
+ , PortalFolder.manage_addPortalFolderForm
+ )
+
+ _CONTENT_TYPES = ( PortalFolder.PortalFolder
+ , CMFBTreeFolder.CMFBTreeFolder
+ )
+
+ _EXTRA_CONSTRUCTORS = ( PortalFolder.manage_addPortalFolder
+ , CMFBTreeFolder.manage_addCMFBTreeFolder
+ )
+
context.registerClass(
DirectoryView.DirectoryViewSurrogate,
constructors=(('manage_addDirectoryViewForm',
@@ -162,19 +159,19 @@
interfaces=(ITypeInformation,))
utils.registerIcon(FSDTMLMethod.FSDTMLMethod,
- 'images/fsdtml.gif', globals())
+ 'images/fsdtml.gif', cmfcore_globals)
utils.registerIcon(FSPythonScript.FSPythonScript,
- 'images/fspy.gif', globals())
+ 'images/fspy.gif', cmfcore_globals)
utils.registerIcon(FSImage.FSImage,
- 'images/fsimage.gif', globals())
+ 'images/fsimage.gif', cmfcore_globals)
utils.registerIcon(FSFile.FSFile,
- 'images/fsfile.gif', globals())
+ 'images/fsfile.gif', cmfcore_globals)
utils.registerIcon(FSPageTemplate.FSPageTemplate,
- 'images/fspt.gif', globals())
+ 'images/fspt.gif', cmfcore_globals)
utils.registerIcon(FSPropertiesObject.FSPropertiesObject,
- 'images/fsprops.gif', globals())
+ 'images/fsprops.gif', cmfcore_globals)
utils.registerIcon(FSZSQLMethod.FSZSQLMethod,
- 'images/fssqlmethod.gif', globals())
+ 'images/fssqlmethod.gif', cmfcore_globals)
utils.ToolInit( 'CMF Core Tool'
, tools=tools
@@ -187,14 +184,15 @@
, extra_constructors=_EXTRA_CONSTRUCTORS
).initialize( context )
- # make registerHelp work with 2 directories
- help = context.getProductHelp()
- lastRegistered = help.lastRegistered
- context.registerHelp(directory='help', clear=1)
- context.registerHelp(directory='interfaces', clear=1)
- if help.lastRegistered != lastRegistered:
- help.lastRegistered = None
+ if 0: # XXX: comment this out for now
+ # make registerHelp work with 2 directories
+ help = context.getProductHelp()
+ lastRegistered = help.lastRegistered
context.registerHelp(directory='help', clear=1)
- help.lastRegistered = None
- context.registerHelp(directory='interfaces', clear=0)
- context.registerHelpTitle('CMF Core Help')
+ context.registerHelp(directory='interfaces', clear=1)
+ if help.lastRegistered != lastRegistered:
+ help.lastRegistered = None
+ context.registerHelp(directory='help', clear=1)
+ help.lastRegistered = None
+ context.registerHelp(directory='interfaces', clear=0)
+ context.registerHelpTitle('CMF Core Help')
Modified: CMF/branches/tseaver-pkg_resources/CMFDefault/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFDefault/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFDefault/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,95 +15,71 @@
$Id$
"""
-from Products.CMFCore.DirectoryView import registerDirectory
-from Products.CMFCore.utils import initializeBasesPhase1
-from Products.CMFCore.utils import initializeBasesPhase2
-from Products.CMFCore.utils import ToolInit
-from Products.CMFCore.utils import ContentInit
-from Products.CMFCore.utils import registerIcon
-from Products.GenericSetup import BASE
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
-import factory
-import utils
-from permissions import AddPortalContent
+cmfdefault_globals = globals()
-import Portal
-import Document
-import Link
-import NewsItem
-import File
-import Image
-import Favorite
-import SkinnedFolder
+def initialize( context ):
-import DiscussionItem
-import PropertiesTool
-import MembershipTool
-import MetadataTool
-import RegistrationTool
-import DublinCore
-import DiscussionTool
-import SyndicationTool
-import DefaultWorkflow
+ from Products.CMFCore.DirectoryView import registerDirectory
+ from Products.CMFCore.utils import ToolInit
+ from Products.CMFCore.utils import ContentInit
+ from Products.CMFCore.utils import registerIcon
+ from Products.GenericSetup import BASE
+ from Products.GenericSetup import EXTENSION
+ from Products.GenericSetup import profile_registry
-contentClasses = ( Document.Document
- , File.File
- , Image.Image
- , Link.Link
- , Favorite.Favorite
- , NewsItem.NewsItem
- , SkinnedFolder.SkinnedFolder
- )
+ import DefaultWorkflow
+ import DiscussionItem
+ import DiscussionTool
+ import Document
+ import DublinCore
+ import Favorite
+ import File
+ import Image
+ import Link
+ import MembershipTool
+ import MetadataTool
+ import NewsItem
+ import Portal
+ import PropertiesTool
+ import RegistrationTool
+ import SkinnedFolder
+ import SyndicationTool
+ import factory
+ import utils
+ from permissions import AddPortalContent
-contentConstructors = ( Document.addDocument
- , File.addFile
- , Image.addImage
- , Link.addLink
- , Favorite.addFavorite
- , NewsItem.addNewsItem
- , SkinnedFolder.addSkinnedFolder
- )
+ tools = ( DiscussionTool.DiscussionTool
+ , MembershipTool.MembershipTool
+ , RegistrationTool.RegistrationTool
+ , PropertiesTool.PropertiesTool
+ , MetadataTool.MetadataTool
+ , SyndicationTool.SyndicationTool
+ )
-bases = ( ( Portal.CMFSite
- , DublinCore.DefaultDublinCoreImpl
- , DiscussionItem.DiscussionItem
- )
- + contentClasses
- )
-
-tools = ( DiscussionTool.DiscussionTool
- , MembershipTool.MembershipTool
- , RegistrationTool.RegistrationTool
- , PropertiesTool.PropertiesTool
- , MetadataTool.MetadataTool
- , SyndicationTool.SyndicationTool
- )
-
-import sys
-this_module = sys.modules[ __name__ ]
-
-z_bases = initializeBasesPhase1( bases, this_module )
-z_tool_bases = initializeBasesPhase1( tools, this_module )
-
-cmfdefault_globals=globals()
-
-# Make the skins available as DirectoryViews.
-if __name__.startswith('Products'): # testrunner may import w/o 'Products'
- registerDirectory('skins', globals())
- registerDirectory('help', globals())
-
-def initialize( context ):
-
- initializeBasesPhase2( z_bases, context )
- initializeBasesPhase2( z_tool_bases, context )
-
ToolInit( 'CMF Default Tool'
, tools=tools
, icon='tool.gif'
).initialize( context )
+ contentClasses = ( Document.Document
+ , File.File
+ , Image.Image
+ , Link.Link
+ , Favorite.Favorite
+ , NewsItem.NewsItem
+ , SkinnedFolder.SkinnedFolder
+ )
+
+ contentConstructors = ( Document.addDocument
+ , File.addFile
+ , Image.addImage
+ , Link.addLink
+ , Favorite.addFavorite
+ , NewsItem.addNewsItem
+ , SkinnedFolder.addSkinnedFolder
+ )
+
ContentInit( 'CMF Default Content'
, content_types=contentClasses
, permission=AddPortalContent
@@ -130,19 +106,25 @@
, icon='images/portal.gif'
)
+ registerDirectory('skins', cmfdefault_globals)
+ registerDirectory('help', cmfdefault_globals)
+
registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
, 'images/workflow.gif'
- , globals()
+ , cmfdefault_globals
)
- # make registerHelp work with 2 directories
- help = context.getProductHelp()
- lastRegistered = help.lastRegistered
- context.registerHelp(directory='help', clear=1)
- context.registerHelp(directory='interfaces', clear=1)
- if help.lastRegistered != lastRegistered:
- help.lastRegistered = None
+ if 0: # XXX: comment this out for now
+ # make registerHelp work with 2 directories
+ help = context.getProductHelp()
+ lastRegistered = help.lastRegistered
context.registerHelp(directory='help', clear=1)
- help.lastRegistered = None
- context.registerHelp(directory='interfaces', clear=0)
- context.registerHelpTitle('CMF Default Help')
+ context.registerHelp(directory='interfaces', clear=1)
+
+ if help.lastRegistered != lastRegistered:
+ help.lastRegistered = None
+ context.registerHelp(directory='help', clear=1)
+ help.lastRegistered = None
+ context.registerHelp(directory='interfaces', clear=0)
+
+ context.registerHelpTitle('CMF Default Help')
Modified: CMF/branches/tseaver-pkg_resources/CMFSetup/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFSetup/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFSetup/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -17,7 +17,8 @@
from AccessControl import ModuleSecurityInfo
-from Products.GenericSetup import BASE, EXTENSION
+from Products.GenericSetup import BASE
+from Products.GenericSetup import EXTENSION
from Products.GenericSetup import ManagePortal
from Products.GenericSetup import profile_registry
Modified: CMF/branches/tseaver-pkg_resources/CMFTopic/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFTopic/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFTopic/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,41 +15,26 @@
$Id$
"""
-import sys
-from ZClasses import createZClassForBase
-
-from Products.CMFCore.utils import ContentInit
-from Products.CMFCore.DirectoryView import registerDirectory
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
-
-import Topic
-import SimpleStringCriterion
-import SimpleIntCriterion
-import ListCriterion
-import DateCriteria
-import SortCriterion
-from permissions import AddTopics
-
-
-bases = ( Topic.Topic, )
-
-this_module = sys.modules[ __name__ ]
-
-for base in bases:
- createZClassForBase( base, this_module )
-
# This is used by a script (external method) that can be run
# to set up Topics in an existing CMF Site instance.
-topic_globals = globals()
+cmftopic_globals = globals()
-# Make the skins available as DirectoryViews
-if __name__.startswith('Products'): # testrunner may import w/o 'Products'
- registerDirectory( 'skins', globals() )
-
def initialize( context ):
+ from Products.CMFCore.utils import ContentInit
+ from Products.CMFCore.DirectoryView import registerDirectory
+ from Products.GenericSetup import EXTENSION
+ from Products.GenericSetup import profile_registry
+
+ import Topic
+ import SimpleStringCriterion
+ import SimpleIntCriterion
+ import ListCriterion
+ import DateCriteria
+ import SortCriterion
+ from permissions import AddTopics
+
context.registerHelpTitle( 'CMF Topic Help' )
context.registerHelp( directory='help' )
@@ -60,6 +45,8 @@
, extra_constructors = (Topic.addTopic,)
).initialize( context )
+ registerDirectory( 'skins', cmftopic_globals )
+
profile_registry.registerProfile('default',
'CMFTopic',
'Adds topic portal type.',
Modified: CMF/branches/tseaver-pkg_resources/CMFUid/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/CMFUid/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/CMFUid/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,40 +15,32 @@
$Id$
"""
-from sys import modules
+cmfuid_globals = globals()
-from Products.CMFCore import utils
-from Products.GenericSetup import EXTENSION
-from Products.GenericSetup import profile_registry
+def initialize(context):
-import UniqueIdAnnotationTool
-import UniqueIdGeneratorTool
-import UniqueIdHandlerTool
+ from Products.CMFCore.utils import ToolInit
+ from Products.GenericSetup import EXTENSION
+ from Products.GenericSetup import profile_registry
-tools = (
- UniqueIdAnnotationTool.UniqueIdAnnotationTool,
- UniqueIdGeneratorTool.UniqueIdGeneratorTool,
- UniqueIdHandlerTool.UniqueIdHandlerTool,
-)
+ import UniqueIdAnnotationTool
+ import UniqueIdGeneratorTool
+ import UniqueIdHandlerTool
-this_module = modules[ __name__ ]
+ tools = ( UniqueIdAnnotationTool.UniqueIdAnnotationTool
+ , UniqueIdGeneratorTool.UniqueIdGeneratorTool
+ , UniqueIdHandlerTool.UniqueIdHandlerTool
+ )
-z_tool_bases = utils.initializeBasesPhase1(tools, this_module)
+ ToolInit( 'CMF Unique Id Tool'
+ , tools=tools
+ , icon='tool.gif'
+ ).initialize(context)
-my_globals=globals()
-
-def initialize(context):
-
- utils.initializeBasesPhase2(z_tool_bases, context)
-
- utils.ToolInit( 'CMF Unique Id Tool'
- , tools=tools
- , icon='tool.gif'
- ).initialize(context)
-
- profile_registry.registerProfile('default',
- 'CMFUid',
- 'Adds UID support.',
- 'profiles/default',
- 'CMFUid',
- EXTENSION)
+ profile_registry.registerProfile( 'default'
+ , 'CMFUid'
+ , 'Adds UID support.'
+ , 'profiles/default'
+ , 'CMFUid'
+ , EXTENSION
+ )
Modified: CMF/branches/tseaver-pkg_resources/DCWorkflow/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/DCWorkflow/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/DCWorkflow/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -15,29 +15,36 @@
$Id$
"""
-from Products.CMFCore.utils import registerIcon
-import DCWorkflow, States, Transitions, Variables, Worklists, Scripts
-import Default
+dcworkflow_globals = globals()
+def initialize(context):
-def initialize(context):
+ from Products.CMFCore.utils import registerIcon
+
+ import DCWorkflow
+ import States
+ import Transitions
+ import Variables
+ import Worklists
+ import Scripts
+ import Default
context.registerHelp(directory='help')
context.registerHelpTitle('DCWorkflow')
registerIcon(DCWorkflow.DCWorkflowDefinition,
- 'images/workflow.gif', globals())
+ 'images/workflow.gif', dcworkflow_globals)
registerIcon(States.States,
- 'images/state.gif', globals())
+ 'images/state.gif', dcworkflow_globals)
States.StateDefinition.icon = States.States.icon
registerIcon(Transitions.Transitions,
- 'images/transition.gif', globals())
+ 'images/transition.gif', dcworkflow_globals)
Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
registerIcon(Variables.Variables,
- 'images/variable.gif', globals())
+ 'images/variable.gif', dcworkflow_globals)
Variables.VariableDefinition.icon = Variables.Variables.icon
registerIcon(Worklists.Worklists,
- 'images/worklist.gif', globals())
+ 'images/worklist.gif', dcworkflow_globals)
Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
registerIcon(Scripts.Scripts,
- 'images/script.gif', globals())
+ 'images/script.gif', dcworkflow_globals)
Modified: CMF/branches/tseaver-pkg_resources/GenericSetup/__init__.py
===================================================================
--- CMF/branches/tseaver-pkg_resources/GenericSetup/__init__.py 2005-11-10 22:02:45 UTC (rev 40039)
+++ CMF/branches/tseaver-pkg_resources/GenericSetup/__init__.py 2005-11-10 22:06:18 UTC (rev 40040)
@@ -3,9 +3,12 @@
$Id: __init__.py,v 1.1.1.1 2005/08/08 19:38:37 tseaver Exp $
"""
+genericsetup_globals = globals()
+
from AccessControl import ModuleSecurityInfo
-from interfaces import BASE, EXTENSION
+from interfaces import BASE
+from interfaces import EXTENSION
from permissions import ManagePortal
from registry import _profile_registry as profile_registry
More information about the CMF-checkins
mailing list