[Zope-Checkins] CVS: Zope/lib/python/App - ZopeComponents.py:1.1.2.1 Management.py:1.48.20.1 __init__.py:1.3.202.1
Shane Hathaway
shane@digicool.com
Wed, 26 Sep 2001 13:39:23 -0400
Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv16148
Modified Files:
Tag: ComponentArchitecture-branch
Management.py __init__.py
Added Files:
Tag: ComponentArchitecture-branch
ZopeComponents.py
Log Message:
Added ZopeComponents module.
=== Added File Zope/lib/python/App/ZopeComponents.py ===
import Interface
class Adder (Interface.Base):
def createWithArguments(args):
"""
"""
def addToContainer(ob):
"""
"""
def resultAfterAdd():
"""
"""
class AdderEntry (Interface.Base):
def getName():
"""
"""
def getAction():
"""
"""
def isGloballyVisible():
"""
"""
def getInterfaces():
"""
"""
def getPermission():
"""
"""
class PresentationAdderEntry:
__allow_access_to_unprotected_subobjects__ = 1
__implements__ = AdderEntry
def __init__(self, name, description, pres_name, interfaces=None,
global_visibility=1, permission=None):
self.name = name
self.description = description
self.pres_name = pres_name
self.interfaces = interfaces
self.global_visibility = global_visibility
self.permission = permission
def getName(self):
return self.name
def isGloballyVisible(self):
return self.global_visibility
def getInterfaces(self):
return self.interfaces
def getPermission(self):
return self.permission
def getAction(self):
return '(p)%s' % self.pres_name
class ClassicAdderEntry:
__implements__ = AdderEntry
visibility = None
interfaces = None
permission = None
action = None
product = None
def __init__(self, mt):
self.__dict__.update(mt)
def getName(self):
return self.name
def isGloballyVisible(self):
return (self.visibility == 'Global')
def getInterfaces(self):
return self.interfaces
def getPermission(self):
return self.permission
def getAction(self):
return self.action
def convertMetaTypeList(mts):
return map(ClassicAdderEntry, mts)
##class AddFeature:
## def __init__(self, description, feature_name):
## self.description = description
## self.feature_name = feature_name
_add_registry = {}
def provideAddPresentation(name, *args, **kw):
if _add_registry.has_key(name):
raise 'Already registered', name
_add_registry[name] = PresentationAdderEntry(name, *args, **kw)
def listAddableTypes(object):
return _add_registry.values()
=== Zope/lib/python/App/Management.py 1.48 => 1.48.20.1 ===
- manage_workspace__roles__=('Anonymous',)
+ manage_workspace__roles__=('Authenticated',)
def manage_workspace(self, REQUEST):
"""Dispatch to first interface in manage_options
"""
=== Zope/lib/python/App/__init__.py 1.3 => 1.3.202.1 ===
#
##############################################################################
+
+from ZopeComponents import Adder, provideAddPresentation