def getImplementsOf(self, instance): """ returns the interfaces implemented by the instance (flat)""" impl = getImplements(instance) if not isinstance(impl, tuple): impl = (impl,) if impl: return flattenInterfaces(impl)
def listInterfaces( self ): """ For ZMI update of interfaces. """ results = [] for iface in flattenInterfaces( self.__implements__ ): results.append( iface.__name__ ) return results
def listInterfaces( self ): """ For ZMI update of interfaces. """ results = [] for iface in flattenInterfaces( providedBy( self ) ): results.append( iface.__name__ ) return results
def listInterfaces(self): """ For ZMI update of interfaces. """ results = [] for iface in flattenInterfaces(providedBy(self)): results.append(iface.__name__) return results
def getImplementsOf(self, instance): """ returns the interfaces implemented by the instance (flat)""" from Interface.Implements import getImplements, flattenInterfaces impl = getImplements(instance) if type(impl) is not TupleType: impl = (impl,) if impl: return flattenInterfaces(impl)
def getInterfacesOf(self, object): """Returns the list of interfaces which are implemented by the object """ impl = getImplements(object) if impl: if type(impl) in (ListType, TupleType): result = flattenInterfaces(impl) else: result = (impl, ) return [iface for iface in result if iface is not Interface]
def getInterfacesOf(self, object): """Returns the list of interfaces which are implemented by the object """ impl = getImplements(object) if impl: if type(impl) in (ListType, TupleType): result = flattenInterfaces(impl) else: result = (impl, ) return [ iface for iface in result if iface is not Interface ]