[Twisted-Python] Film At 11

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Nov 7 09:49:56 EST 2001


This conversation has been edited for length, to fit your screen, and, 
in some cases, content:

<itamar> hi glyph
<glyph> hit itamar
<glyph> hi itamar, even ;)
<itamar> I'm glad to say we now have java interop
<glyph> itamar: So I read from the list
<itamar> now's about the point where I could use some help
<itamar> not that that's gonna happen
<glyph> itamar: So I thought of another cool hack that you might want to 
work on
<glyph> totally unrelated to java ;)
<itamar> yes?
<glyph> itamar: Don't run away --
<glyph> "The configuration system"
<itamar> mmm
<glyph> itamar: I just had a conversation about it last night.
<itamar> what exactly where you thinking of?
<glyph> itamar: Let me ramble about vision for a moment (you'll probably 
see this in an email sometime soon, too)
<itamar> ok
<glyph> Twisted isn't a particularly great webserver, when you compare 
functionality blow-for-blow with apache.  It's not a great chatserver, 
when it has to slug it out with ircd.  But we all like Twisted more than 
either of those -- why?
<glyph> Well, because it's an IRC server *and* a web server.
<itamar> right
<glyph> What makes Twisted special is the degree of integration that it 
allows for all its services.
<glyph> However, this integration is effectively lost to anyone who 
isn't a programmer (and to some extent, to anyone who isn't already 
rather familiar with the codebase) because there's no metaphor for the 
integration.  Everything is rather concrete, speaking in terms of file 
descriptors and delayed events and what-have-you.
<itamar> glyph: ok -
<glyph> With the refactoring that we're talking about, centering around 
t.i.m.A, there is going to be at least a common metaphor for what stuff 
connects to what bit of the network...
<itamar> right
<glyph> The configuration application that I envision has a unified 
notion of the "things that do stuff", although I haven't come up with a 
good name for them.  Zope-like, you'll have a menu to create an object 
of lots of different types (like a Words service, a mail service, a web 
site, etc), some of which listen on ports directly, some of which are 
indirectly connected to the network through PB publishers or web 
resources.
<itamar> well, meanwhile it sounds like a mktap with a slightly better UI
<glyph> itamar: the use-case that I'm thinking of for it is creating a 
web site and a words service, hooking up a tendril to a persistent IRC 
server, creating a personal website and mounting the registration and 
userlist widgets somewhere within your personal web space.
<itamar> hmmm... a configuration tool for web would be quite nice for 
starters, yes
<glyph> itamar: Note that I mention spawning a tendril as well -- one of 
the goals of this tool would be to unify mktap and im.  You really ought 
to just create a "persistent outgoing chat connection w/ Tkinter UI" as 
an object, put it in your tap, and have it run in your personal twistd 
server
<glyph> itamar: this would also clearly define the role of "plugins" -- 
they are code which adds stuff to that menu of base types of objects one 
can create
<glyph> I'm inclined to say that for starters, each object defines its 
own web form that allows you to configure it
<itamar> how would you model something that connects web and a words 
service?
<itamar> this is where you start wishing for a 3d gui
<glyph> itamar: optimally, yeah, you'd have something like a 3D visio 
where you could dynamically drag connections
<itamar> actually a 2d one would do
<glyph> but working with "web form" as the metaphor, there's still quite 
a lot you can do :)
<itamar> where you drag lines from a object to another
<glyph> when you create a words service, it publishes several web 
objects, none of which are connected to anything
<glyph> so when you go to a page that wants to pop up a list of possible 
objects you could add as a web resource, those appear.
<glyph> It's like your application has a "bag" of sub-objects that you 
"carry around" in the configuration interface
<itamar> I like it. of course my innate dislike of web (or GUI, for that 
matter) programming is getting in the way.
<itamar> but it would be good for my software as well, since it has all 
these pluggable components you need to mix and match
<itamar> and then there's monitoring components (web, nt performance 
monitor)
<itamar> and logging components (syslog, file, nt log)
<glyph> itamar: Yeah.  The reason that this configuration thing came to 
me is because someone who was asked to do a technical evaluation of 
Twisted, upon completing his evaluation, had only one thing to say
<glyph> "What is it *for*?"
<itamar> what?
<itamar> what is what for?
<glyph> itamar: What is Twisted for.
<sayke> glyph: that was my response. "that's a damn impressive kitchen 
sink ya got there" ;)
<glyph> itamar: and I realized that *this* is what Twisted is for.  Even 
though we don't have a very good metaphor for it or interface to it, no 
other server framework even aspires to this sort of integrated 
environment.
<glyph> There are a few "java Application servers" that make-believe, 
except that they ONLY do web, and ONLY for business, and severely limit 
the sort of apps you can write with them.
<itamar> yeah, or Zope, which has ftp/http/webdav/xmlrpc, but attempts 
to add nttp or imap have failed
<glyph> itamar: ftp/http/webdav/xmlrpc are still all just ways of 
publishing structured documents
<glyph> itamar: they're not fundamentally different ways of interacting 
with the system
<itamar> yeah
<glyph> itamar: nntp and imap, strangely enough, are :)
<itamar> well, actually, there's a irc bot written for zope
<itamar> on to concretes - is there any way we can do without a web 
interface?
<glyph> itamar: well, a first step in this direction is just a unified 
set of utility methods :)
<itamar> how about anygui? they are promising a html interface
<glyph> itamar: anygui is crack
<itamar> and a curses interface
<itamar> glyph: why do you say that?
<glyph> itamar: Have you ever done any work with webwidgets?
<itamar> nope
<glyph> itamar: take a look at the form widget
<glyph> itamar: it's staggeringly little code to write
<itamar> one sec
<itamar> where can I find an example?
<glyph> You might have to refactor it a little bit, but the basic idea 
is you define what inputs your form takes, then it renders the form for 
you and calls back to a method with the appropriate signature with each 
form value as an arguemnt when the user POSTs
<itamar> ok, so we can have a generic configuration API, and have a web 
interface to that, and a tkinter interface to it etc.?
<glyph> itamar: twisted.web.guard.AuthForm
<glyph> itamar: yes.
<glyph> itamar: I don't want to do anygui, because I'd like the tkinter 
interface to be *different* from the web interface.  To begin with I 
think we should go with web-only and refactor once we see what 
ocnfiguration patterns emerge, but if you want to go with tkinter-only 
or gtk-only for the first pass... hey, I don't have the time to write 
this :)
<itamar> mmmm
<itamar> how about registry.registerThingie(type, description, 
parameters, factoryCallable)
<itamar> registry.listThingies(type)
<itamar> I'm going to eat
<itamar> glyph: mail the log to the list



--
______      you are in a maze of twisted little applications, all
|   |_\     remarkably consistent.
|     |          -- glyph lefkowitz, glyph @ twisted matrix . com
|_____|             http://www.twistedmatrix.com/





More information about the Twisted-Python mailing list