Commit b5f0baec authored by Andreas Jung's avatar Andreas Jung

- Collector #166: ObjectManger.all_meta_types() implemented only

        an incomplete filter based on interfaces.
parent 2722e047
......@@ -16,6 +16,9 @@ Zope Changes
- Collector #210: HTML() function of StructuredText produced wrong
<h0> tags.
- Collector #166: ObjectManger.all_meta_types() implemented only
an incomplete filter based on interfaces.
Zope 2.5.1 beta 1
Bugs Fixed
......
......@@ -12,9 +12,9 @@
##############################################################################
__doc__="""Object Manager
$Id: ObjectManager.py,v 1.146 2002/02/07 17:20:59 andreasjung Exp $"""
$Id: ObjectManager.py,v 1.147 2002/02/13 15:27:48 andreasjung Exp $"""
__version__='$Revision: 1.146 $'[11:-2]
__version__='$Revision: 1.147 $'[11:-2]
import App.Management, Acquisition, Globals, CopySupport, Products
import os, App.FactoryDispatcher, re, Products
......@@ -150,12 +150,29 @@ class ObjectManager(
default__class_init__(self)
def all_meta_types(self, interfaces=None):
pmt=()
if hasattr(self, '_product_meta_types'): pmt=self._product_meta_types
_pmt=()
if hasattr(self, '_product_meta_types'): _pmt=self._product_meta_types
elif hasattr(self, 'aq_acquire'):
try: pmt=self.aq_acquire('_product_meta_types')
try: _pmt=self.aq_acquire('_product_meta_types')
except: pass
if interfaces is None: pmt = list(_pmt)
else:
pmt = []
for entry in pmt:
try:
eil = entry.get('interfaces',None)
if eil is not None:
for ei in eil:
for i in interfaces:
if ei is i or ei.extends(i):
pmt.append(entry)
raise BreakoutException # only append 1ce
except BreakoutException:
pass
gmt = []
for entry in Products.meta_types:
......@@ -175,7 +192,7 @@ class ObjectManager(
except BreakoutException:
pass
return list(self.meta_types)+gmt+list(pmt)
return list(self.meta_types)+gmt+pmt
def _subobject_permissions(self):
return (Products.__ac_permissions__+
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment