hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
On 18 May 2004, the following message was posted to this mailinglist:
Jp Calderone exarkun at divmod.com wrote:
>Daniel Newton wrote:
> I have a simple XML-PRC server similar to the example below:
> from twisted.web import xmlrpc, server
> class Example(xmlrpc.XMLRPC):
> """An example object to be published."""
> def xmlrpc_add(self, a, b):
> """Return sum of arguments."""
> return a + b
> if __name__ == '__main__':
> from twisted.internet import reactor
> r = Example()
> reactor.listenTCP(7080, server.Site(r))
> I want to be able to get the address of the client that calls the
> method can anyone help me with this?
This solution didn't work because 'transport' isn't a property of the
I'm currently in the process of changing from a customized
SimpleXMLRPCServer to a twisted XMLRPC server solution and I need to
insert the client IP into the attributes passed to the called xmlrpc
method. Anyone who knows the answer and is willing to share the info?
Does anyone have some example code for building a reconnecting PB client?
This is what I have now:
from twisted.spread import pb
from twisted.internet import reactor
from twisted.python import util
events = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, events)
queue = events.getRootObject()
I'm using Twisted 1.3.0 on python2.4 on an Ubuntu-Hoary x86 Linux box.
I'm using twisted and spawnProcess() with a Queue structure to chain
processes that need to be called (specifically, imagemagick commands).
I use the "processEnded" event/method of t.i.p.ProcessProtocol to go
from one task to the next. Twisted shares a python process with a
multi-threaded web-app-kit (Webware) so it has to be run in a thread.
This worked well on other older versions of twisted and older versions
of python; also on linux. I've tracked down the problem to be twisted
itself (or my incorrect use of it) rather than my code. This example
from twisted.internet import reactor
from twisted.internet.protocol import ProcessProtocol
class MyProt( ProcessProtocol ):
def processEnded(self, reason):
print "ended.", reason
executable = '/bin/touch'
args = ( '/tmp/foo.txt', )
args = (executable,) + tuple(args)
reactor.spawnProcess( MyProt(), executable, args )
reactor.callLater( 5, reactor.stop )
As is, this code never runs the "processEnded()" method of MyProt().
If I change the reactor.run() parameter to leave the signal handlers
on, it works.
Note that I need to leave the signal handlers turned off because I
can't run the reactor in the main thread; Webware needs that.
I also know that the subprocess is giving up its file descriptors; I
can see that if I put more print statements into MyProt(). And I know
that the subprocess is working; /tmp/foo.txt is there.
It seems that somehow the reactor is using signals to notice when a
process has ended; this makes a certain ammount of sense intuitively,
though I don't understand the nitty-gritty of processes and signals at
all. And more importantly, this has worked before on other
combinations of twisted/python.
Is this a bug? If so, has it been fixed? If not, what should I do to
detect when a spawned process is finished?
Thanks very much. Twisted rocks.
I ran into a problem on HP-UX (B.11.23 U ia64) using Python 2.4.3,
whereby processes started via reactor.spawnProcess() never seem to
get the completion event.
I fished around via Google and found that this is ticket #608, which
has been hanging around for over 2 years.
I'd be willing to help troubleshoot this if someone could provide
some guidance. I'd really like to get this fixed ASAP, so any help
Thanks. Please reply to me directly in addition to the list, as I'm
I am not sure my original message made it to the list, so I thought I
would reissue it. If you have seen it before, I am sorry for issuing it
I have an XMLRPC server and client. I am trying to build both of them
defensively - in other words I would like to cancel the client request
should a time period be exceeded. I would also like to give the server a
specific time to answer. Can anyone give me an idea how to do them?
Peace, and thanks in advance,
I am completely new to twisted, but want to give it a try :)
I have a small website running, serving dynamic content with Pylons.
For switching to twisted, do I have to use the web or the web2 module?
I'm new to twisted and I have some problems on understandins some
basic concepts on building applications upon the twisted framework.
The examples in Fettig's book brought me on the right track I think
but I'm not sure. So I would like to ask you for some hints and
I try to build a small IMAP client which shoul be able so do some
very basic operations lke mailboxlisting and fetch some images.
Nothing more for the first. Based on Fettig's IMAP examples I did the
For each operation I want to do I wrote a own protocol. I started
with a basic protocol which simply connects to the server. Then in
the next step I wrote the protocol which lists the users mailbox.
This protocol is inheritated from the first exentend this with the
methods to list the mailbox. As you can see I planned to build some
kind of inhertance tree for the protcols. Continuing this way I
would end up with many small protocols doing one single task, and
I'm not sure If this is a good approach. Do you have any comments on
If it is not clear to you what I meant I can provide some code of
course. At the moment this things is pretty small :)