[Twisted-Python] We now have a coil command-line app in CVS
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Now you can configure your TAP files through the web! Usage: coil [--new=<application name>] <tap file> Options: -n, --new= -p, --port= [default: 9080] For example, to configure a TAP generated by mktap: $ mktap web $ coil web.tap (now point browser at http://localhost:9080) Or to create a new TAP: $ coil --new=myapp new.tap (now point browser at http://localhost:9080)
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Fri, 2002-03-29 at 04:24, Itamar Shtull-Trauring wrote:
Now you can configure your TAP files through the web!
Nifty, but not quite in line with the vision I have for the way Twisted ought to work. It raises an interesting problem though because I can't figure out how I'd implement such functionality, and I think it's useful functionality to have :-). The goal of the .tap/twistd system is to separate the configuration of the application objects from the way they are run. The goal of this separation is to run the same TAP file with multiple "loader" programs, (theoretically) one for each platform/mainloop. A development server might run in a GTK mainloop that instruments various things, to allow you to view what ports are open, and to where. The Win32 loader would allow you to load the same config through an NT Service GUI, or a system tray icon, depending on whether you purchased the "Duplo" or "Lego" version of the win32 API. I can't think of a general solution to the "run a tool which requires starting up a Twisted service, but also requires arguments" problem, but it might be useful for each loader to have a "run a coil on this Application object" option. (Keep in mind also that it would be neat to have certain loaders be able to run multiple concurrent application objects) -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mon, 2002-04-01 at 03:09, Itamar Shtull-Trauring wrote:
Glyph Lefkowitz wrote:
The goal of the .tap/twistd system is to separate the configuration of the application objects from the way they are run.
So? when I use the coil app I do not run the .tap, I just configure it.
When I use the twistd app I run the .tap.
What is the issue?
The coil app is an app by itself, right? And *that* app runs. -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
The issue is that there's no mechanism for the user to select which mainloop the configuration app should be using. The default mainloop might not work on your platform (java, for example) On Mon, 2002-04-01 at 04:22, Itamar Shtull-Trauring wrote:
Glyph Lefkowitz wrote:
The coil app is an app by itself, right? And *that* app runs.
Yes, but it's a different one than the one that being configured. Again, what is the issue?
-- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Glyph Lefkowitz wrote:
The issue is that there's no mechanism for the user to select which mainloop the configuration app should be using. The default mainloop might not work on your platform (java, for example)
Ah. Well, coil could be turned into a python module, together with a shell script/.bat that uses twistd to run it. Once you do the promised event loop refactor, that is. :) What module organization should that be? Tv suggested twisted.internet.eventloops.{gtk, select, poll, ...} The current system is icky. ingtkernet is *such* a bad name, and the others aren't any better.
![](https://secure.gravatar.com/avatar/b3407ff6ccd34c6e7c7a9fdcfba67a45.jpg?s=120&d=mm&r=g)
On Mon, Apr 01, 2002 at 03:08:58PM +0300, Itamar Shtull-Trauring wrote:
Ah. Well, coil could be turned into a python module, together with a shell script/.bat that uses twistd to run it. Once you do the promised event loop refactor, that is. :)
What module organization should that be? Tv suggested twisted.internet.eventloops.{gtk, select, poll, ...}
I like the idea of calling them "eventloops", or basically anything other than "main". "main" tends to clash with functions in my modules, and "eventloop" gives a clearer idea of its purpose. Tv's suggestion looks reasonable to me... although aren't there really two types of modules being grouped together there: 1) Alternatives to the select-based loop (poll, win32) 2) Add-ons that integrate Twisted's loop with other loops, e.g. gtk, Tk, etc... Or do the 2nd type all assume a select-based loop? If that's the case, I'd suggest they are generalised (it'd be nice for Tk to work with the win32 loop). I guess then I'd be proposing something like: * twisted.internet.eventloops.{select, poll, win32} * twisted.internet.eventloops.addons.{gtk, tk, wx, asyncore?, ...} I'm not really thrilled with the name "addons", but you get the idea. -Andrew.
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Andrew Bennetts wrote:
Tv's suggestion looks reasonable to me... although aren't there really two types of modules being grouped together there: 1) Alternatives to the select-based loop (poll, win32) 2) Add-ons that integrate Twisted's loop with other loops, e.g. gtk, Tk, etc...
Or do the 2nd type all assume a select-based loop? If that's the case, I'd suggest they are generalised (it'd be nice for Tk to work with the win32 loop) Actually, it's more complex:
1a) There's select(), poll() or win32 1b) GTK+ and Qt also replace the event loop, so they are in category (1) 2) wxPython can integrate with anything in (1a), I think 3) Jython totally replaces everything, including the TCP support The Tk event loop is in category (2) I *think*.
participants (3)
-
Andrew Bennetts
-
Glyph Lefkowitz
-
Itamar Shtull-Trauring