[Twisted-Python] components.Interface with pb.Referenceable

W.J. miathan at goliath.darktech.org
Sat May 10 11:20:56 EDT 2003


Hello,

I just can't seem to get some things straight about the Interface and
Component system used in Twisted.

Take for example Manhole;

The Interface defines three methods; console, receiveExplorer and
listCapabilities:

class IManholeClient(components.Interface):
    def console(self, list_of_messages):
    def receiveExplorer(self, xplorer):
    def listCapabilities(self):

In twisted/manhole/ui/gtk2manhole.py The class ManholeClient _claims_ to
implements this interface:

class ManholeClient(components.Adapter, pb.Referenceable):
    __implements__ = (IManholeClient,)

Well, strictly seen it doesn't. It defines the methods remote_console,
remote_receiveExplorer and remote_listCapabilities (!).

It does not define either of console, receiveExplorer and
listCapabilities.

What is the use of claiming it does implement it? Probably there is
something about interfaces used in the perspective broker that I don't
understand.

Why isn't there a different notation for remote and local
interfaces? Like ILocalManholeClient and IRemoteManholeClient, wherein the
first is like the current IManholeClient, and the second with
methods remote_ prefixes.

Wladimir






More information about the Twisted-Python mailing list