[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - ClassFactory.py:1.1.2.1

Gary Poster garyposter@earthlink.net
Mon, 29 Apr 2002 19:25:18 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv12342

Added Files:
      Tag: Zope-3x-branch
	ClassFactory.py 
Log Message:
needed ClassFactory.py



=== Added File Zope3/lib/python/Zope/App/ZMI/ClassFactory.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
""" ZMI Addable Registration

$Id: ClassFactory.py,v 1.1.2.1 2002/04/29 23:25:17 poster Exp $
"""

from Zope.ComponentArchitecture.IFactory import IFactory

class ClassFactory:
    
    __implements__ = IFactory

    def __init__(self, _class):
        self._class = _class

    def __call__(self, *args, **kwargs):
        return self._class(*args, **kwargs)
    
    def getInterfaces(self):
        return getattr(self._class, '__implements__', None)