Back to index

plone3  3.1.7
command.py
Go to the documentation of this file.
00001 # Copyright (c) 2005-2007
00002 # Authors: KSS Project Contributors (see docs/CREDITS.txt)
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 version 2 as published
00006 # by the Free Software Foundation.
00007 #
00008 # This program is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 # GNU General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU General Public License
00014 # along with this program; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00016 # 02111-1307, USA.
00017 
00018 from plugin import KSSPlugin
00019 from interfaces import ICommand
00020 from plugin import KSSPluginError
00021 import zope.component as capi
00022 from zope.interface import implements
00023 
00024 def checkRegisteredCommand_old(name):
00025     'Check if it is a registered command.'
00026     try:
00027         command = capi.getUtility(ICommand, name)
00028     except capi.ComponentLookupError:
00029         raise KSSPluginError, '"%s" is not a registered kss command' % (name, )
00030 
00031 class Command(KSSPlugin):
00032     '''The command plugin
00033 
00034     '''
00035 
00036     implements(ICommand)
00037 
00038     def __init__(self, name, jsfile):
00039         KSSPlugin.__init__(self, name, jsfile)