Janko Hauser wrote: >> OK - this was a bit confusing. One more try: >> >> I want to make an object provided one interface (IFile) always and one >> interface (IImage) "sometimes". Sometimes means "whenever libmagic >> thinks, >> the file is an Image". I don't want to modify any interface but only the >> object's list of provided interfaces. > > So it's an additional interface. Look up the usage of > "directlyProvides', with this, one can set additional interfaces on an > instance.
I would recommend using (and advocating) alsoProvides because directlyProvides REsets all marker interfaces. alsoProvides only adds them and won't remove any. > It is often used for marker interfaces. This would also be a > hint for your problem, only set a marker on the file object, so that > image related adapters could be used for this marked instance. Yup. Philipp _______________________________________________ Zope3-users mailing list [email protected] http://mail.zope.org/mailman/listinfo/zope3-users
