<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
luis wrote:
<blockquote cite="mide3lq0o$fo4$1@sea.gmane.org" type="cite">
<pre wrap="">Jean-Marc Orliaguet wrote:
</pre>
<blockquote type="cite">
<pre wrap="">sorry I thought you wanted to do something else.. maybe you want to use
'alsoProvides' if it is to set a marker, to avoid removing other
interfaces that the file might provide?
/JM
</pre>
</blockquote>
<pre wrap=""><!---->
nop. that's not it... I still havn't figured it out, but it seems very
strange to me. it seems like folder-like objects work, but content-like
objects don't..
for example
folder = Folder()
interface.directlyProvides( folder, IMarker )
file = File()
interface.directlyProvides( file, IMarker )
root['folder'] = folder
root['file'] = file
would leave "folder" directly providing the "IMarker" interface, but "file"
directly providing nothing.
the other strange thing is that the interface seems to be added to the
provided-list, but then it is removed again later...so when you look at the
introspector tab in the zmi, it's gone.
regards.luis
</pre>
</blockquote>
<br>
are you sure? I tried with:<br>
<br>
jmo@localhost ~/Zope3/src $ python2.4<br>
Python 2.4.2 (#1, Dec 4 2005, 15:28:38)<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> from zope.app.file import file<br>
>>> f = file.File()<br>
>>> f<br>
<zope.app.file.file.File object at 0xb7cbad2c><br>
>>> import zope.interface<br>
>>> class IMarker(zope.interface.Interface):<br>
... """Marker interface"""<br>
... <br>
>>> zope.interface.directlyProvides(f, IMarker)<br>
>>> list(zope.interface.directlyProvidedBy(f))<br>
[<InterfaceClass __main__.IMarker>]<br>
>>> IMarker.providedBy(f)<br>
True<br>
<br>
hope it helps<br>
/JM<br>
<br>
<br>
</body>
</html>