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
I would like to announce txZMQ, ZeroMQ bindings for Twisted. txZMQ is based
on pyzmq and requires recent ØMQ version (>=2.1).
txZMQ uses ØMQ APIs to get file descriptor that is used to signal pending
actions from ØMQ library IO thread running in separate thread. txZMQ should
be usable with any Twisted reactor.
* The socket library that acts as a concurrency framework.
* Carries messages across inproc, IPC, TCP, and multicast.
* Connect N-to-N via fanout, pubsub, pipeline, request-reply.
* Fast enough for clustered products and supercomputing.
* Asynch I/O for scalable multicore message-passing apps.
Bridging ØMQ and Twisted makes a nice match: fast simple messaging between
Twisted instances solving complex problems :)
* PyPi: http://pypi.python.org/pypi/txZMQ/
* Source code: https://github.com/smira/pyzmq
* pyzmq: http://pypi.python.org/pypi/pyzmq
* ØMQ: http://www.zeromq.org/
Qik Web Team Lead
I have an xml file in my application,
I have created an element using
Example goes like this.........
and i appeneded it by using append() method.
But how i can reflect this change to my xml file?
and one more thing is i want to create element with some other parameters....
<abc m=" " n=" ">
and i have m and n values as strings with me.
can anybody help me to create this element and write it to the existing xml file
as a child of an existing element?
Thanks in advance..
Forgot the famous last words? Access your message archive online at http://in.messenger.yahoo.com/webmessengerpromo.php
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?
I encountered a problem while dealing with file transfers using PB and t.s.u.FilePager.
The sscce illustrates the problem:
--------- server.py --------------------------------------------------
from twisted.spread import pb
from twisted.internet import reactor
ROOT = '/tmp/'
def __init__(self, fd):
self.fd = fd
def remote_gotPage(self, page):
def remote_createImage(self, imageId):
return ImageCollector(open(ROOT + imageId, 'w'))
--------- client.py --------------------------------------------------
from twisted.spread import pb
from twisted.internet import reactor, defer
from twisted.spread import util
FILE = 'myfile.something'
factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, factory)
d = factory.getRootObject()
return controller.callRemote('createImage', 'image-id')
print ctl.callRemote('dummy') ############# LINE 19 #############
d = defer.Deferred()
util.FilePager(ctl, open(FILE), callback=lambda: d.callback(None))
print "Transfer completed"
I'm trying to *upload* a file from the client to the server by calling a method on the
server which returns a collector to be used with a FilePager instance.
When run with the line client.py:19 commented out, the script blocks before sending
out any file chunks, if the line is uncommented (effectively calling the 'dummy' method
remotely), everything works as expected.
Digging around in the sources, I found out that t.p.u.Pager registers itself to the
collector's pb broker as a pageProducer. When resumeProducing is called on the broker,
it asks the FilePager instance for the next page, which leads to the invocation of
the following method on FilePager::
Get the first chunk read and send it to collector.
if not self.chunks:
val = self.chunks.pop(0)
As the t.b.FileSender producer does not yet had a chance to write something to the
FilePager, the method returns straight away without sending anything.
As anything was sent, the Broker.resumeProducing method is never called again, and
thus the FilePager.sendNextPage neither.
The problem is caused by the calling chain of the FilePager constructor:
-> <no data, don't send anything>
-> FileSender().beginFileTransfer(fd, FilePager)
-> <store data, wait for sendNextPage to be called>
Simply inverting these two method calls (Pager.__init__ and FilePager.startProducing)
solves the problem.
The same problem does not appear when calling the 'dummy' method (client.py:19)
because the data for the method call is waiting to be sent out by the reactor and
the transport does not call 'resumeProducing' on the broker until the next iteration.
This allows the call to FilePager.startProducing to complete before sendNextPage is
ever called on it.
Does this sound correct? It seems only strange to me that nobody else had this problem
previously. If no errors on my side are found, I'll submit this as a ticket.
As some of you may already know (either through a backchannel or because you
talked to me at Europython), there has been some talk about moving Twisted
way from Trac+SVN to somewhere that isn't Trac+SVN.
A lot of the devs do like SVN. My guess is that that's mainly because they
don't actually use SVN, they use Combinator, or something. On the other
hand, I do think that Trac is pretty universally loathed, and it would be a
good idea to get away from it.
There's a few existing hosting solutions:
1. Launchpad (+ Bazaar as the default vcs)
2. Bitbucket (+ Mercurial as the default vcs)
3. Github (+ Git as the default vcs)
Although I've hated git for a long while (and I still don't like it very
much), I firmly believe Github is the right thing for Twisted. My incredibly
unscientific poll amongst people who like Twisted but aren't devs is that
they all love or at least like Github, and a surprising number has a
distaste for Launchpad (unfamiliarity with Bazaar, perceived
developer-unfriendly UI, slowness).
Unless someone is going to go all "NO GITHUB IS TERRIBLE AND YOU ARE A BAD
PERSON FOR EVEN SUGGESTING IT" on me, maybe we can talk about planning the
I have been using Twisted for about 6 months and looking for ways in
which I could help the project.
I just read the announcement and I would like to volunteer for one of
the Twisted jobs.
I am familiar with bzr and git and for the beginning I would like to
start with maintaining the version control mirrors (bzr and git) and if
this will not consume all my free time, I would also like to take care
of buildbot master and slaves (or some other job that you consider is
Beside the job description, I was thinking that creating repositories
mirrors on Github/Gitorious could be useful.
The Launchpad BZR mirror seems to be functional.
Hoping that I can be useful, please let know if my application is
I have a question about the "best practices" on making callbacks and making sure you don't hog the reactor.
So you pass a deferred to a client, who attaches a chain of callbacks that might probably do some CPU intensive stuff. How should one guard for that? The obvious solution to me for the server part would be to do
reactor.callLater(0, d.callback, arg)
What about the client part? What would be the best way to have a chain of callbacks executed in such a way that the reactor isn't blocking during that time?