[Reality] Faucet API & class, round 1
Glyph Lefkowitz
glyph@twistedmatrix.com
Thu, 16 Mar 2000 14:41:37 -0500 (EST)
On Thu, 16 Mar 2000, Michael Dartt wrote:
> Clarification: the GUI API is basically us saying, "If you write a
> front-end, could you please name your functions and variables/widgets/etc.
> according to these guidelines?" So it's really just an interface--no
> official code to go with it.
Okay. I draw your attention to lines 280-290 of protocol.py:
def __init__(self):
self.commands={CMD_Hears: self.hear,
CMD_SetName: self.name,
CMD_DescAppend: self.describe,
CMD_SetTheme: self.theme,
CMD_DescClear: self.desc_clear,
CMD_ListClear: self.list_clear,
CMD_Exits: self.exits,
CMD_ListAdd: self.list_add,
CMD_ListRemove: self.list_remove,
CMD_CompletedAction: self.reactivate}
I'd say that that little snippit fairly clearly defines an interface,
wouldn't you? ;-)
> The criteria I used for splitting stuff up was that the GUI stuff only
> deals with toolkit-specific issues--widgets, displaying info, etc. The
> Faucet module will handle the manipulation and storage of the information,
> since that's common to all clients, no matter what toolkit is being used.
> Finally, the front-end won't be ignorant of the stuff in Faucet.py, b/c
> it'll inherit from it.
I don't think that the data would be useful; as I said in my last email,
each GUI is going to have to store the data in a different format,
especially if there's going to be tree or other list-type widget being
used for the item display stuff. The only thing that might be useful is
the description handling.
> The point of this is to make it easier to develop Faucets--the only thing
> one has to do is write the GUI code.
It's pretty close to that right now, looking at what we've got... maybe it
could be better documented...
> As far as merging Faucet.py with FaucetProtocol, I'm a bit leery of that
> b/c the protocol implies the means by which the Faucet interacts with the
> Pump, rather than how the Faucet operates internally.
I guess, but the distinction seems academic to me. Is there ever
somewhere you'd want to use a Faucet protocol without using a Faucet?
> Does this clear things up?
a bit.
> --Mike
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
http://www.twistedmatrix.com/~glyph/