Back to index

plone3  3.1.7
configure.py
Go to the documentation of this file.
00001 
00002 import os.path
00003 from kss.core.pluginregistry.interfaces import ICommand
00004 from kss.core.pluginregistry.command import Command
00005 from kss.core.pluginregistry.plugin import registerPlugin
00006 from kss.core.deprecated import deprecated_directive
00007 from kss.core.pluginregistry import configure as _configure
00008 
00009 def registerCommand(_context, name, jsfile=None):
00010     'Directive that registers a command' 
00011     # check to see if the file exists
00012     if jsfile is not None:
00013         file(jsfile, 'rb').close()
00014 
00015     _context.action(
00016         discriminator = ('registerKssCommand', name, jsfile),
00017         callable = registerPlugin,
00018         args = (Command, ICommand, name, jsfile),
00019         )
00020 registerCommand = deprecated_directive(registerCommand, 'azax:registerCommand',
00021         'use kss:registerAction with command_factory="selector" or "global"')
00022 
00023 registerEventType = deprecated_directive(_configure.registerEventType, 'azax:registerEventType', 'use kss:registerEventType instead')
00024 registerAction = deprecated_directive(_configure.registerAction, 'azax:registerAction', 'use kss:registerAction instead')
00025 registerSelectorType = deprecated_directive(_configure.registerSelectorType, 'azax:registerSelectorType', 'use kss:registerSelectorType instead')
00026 registerCommandSet = deprecated_directive(_configure.registerCommandSet, 'azax:registerCommandSet', 'use kss:registerCommandSet instead')