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 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 have a sample XMPP client with the following structure:
from twisted.words.protocols.jabber import client, jid
from twisted.internet import reactor
factory = client.basicClientFactory(myJid, myPasswd)
It works well, I can connect to the XMPP server. But I would appreciate
if some one could give me some hints on what's required to get the
client to connect using a secure SSL link.
I didn't want to hijack the 'Twisted Presentation Materials..' thread,
so I started this one ...
First off, in the other thread,
Glenn, you mentioned Storm. I have heard of Storm, but never got
any deeper that noticing that it is still a work in progress (maybe
things have settled down ?)
If anyone has anything to say on how it might be a good choice with
Twisted, please feel free to enlighten us!
But, I hoping to solve some immediate problems with Twisted and
SQLAlchemy, so ...
>> * A main "App Server", that controls high level access with "twisted.cred"
>> * Web frontend: "twisted.web2"
>> * Data: some "twisted.enterprise.adbapi", moving to SQLAlchemy.
> Interesting; how are you handling asynchrony in SA?
This is the issue that we're stilling unclear on, and I really
would like to know of the best way of integrating Twisted with SQLAlchemy.
Twisted devs / experts: Please, could you comment on the right way of
using Twisted and SQLAlchemy together.
Anyone: If anyone know of existing code that integrates Twisted and
SQLAlchemy nicely, please share!
RIght away I just went about the problem be wrapping each call
to SQLAlchemy in a "deferToThread" inside my "DatabaseManager" class.
At startup of my app, I make an instance of this class, and pass it to
each "avatar" (in "requestAvatar", in my portal)
Here is my Database Manager: (you will actually see that I 'turned
off' the deferToThread wrapping for now):
but I really haven't convinced myself that this is the best way of doing things.
Hell, it could be totally wrong, so if anyone has any advice, I would
be very appreciative!
> I'm aware of sAsync,
> but haven't looked much into it. (I'm a step or two behind you, actively
> using adbapi, and thinking about moving to SA when I get some breathing
I've looked into SAsync as well, but it is not totally clear to me
what the extra benefit of it is (again, anyone who has a good
description, please tell)
The main developer of sAsync use to post to this mailing list, but I haven't
seen him post in a fairly long while.
So, if others are thinking about using SQLAlchemy with Twisted, let's
discuss it more.
Thanks very much,
I would like to build a syslog(udp port 514) listener in twisted. The goal
is to make it compatible with syslog and syslog-ng, which may be configured
on a "client" to send log entries (as they occur) via udp (fire and forget)
to a remote server (my twisted server).
Is there already something out there that would do this or that would be a
I'm thinking about using Twisted to rewrite some communications in a
Grid computing application.
[JobServer]1 ---------- *[Proxy]1 ----------- *[Agents]
Agents get jobs, report status, results, etc through Proxy to
JobServer. Agents are often distributed across a private network that
has no external interface, hence the proxy, which is run on a machine
between the private network and internet. Also, the proxy may do some
caching/queuing of particular messages - especially where the number
of agents behind it is large.
What we have at present is a TCP socket server however we're starting
to hit scalability issues and on top of that our future plans
necessitate a notification framework. I've been digging around on
twistedmatrix.com and in the book but so far am having trouble finding
any guidance or the level of detail that tells me whether Twisted has
what we need, some bits of which are:
- we'd like to use a persistent stream/connection, at least between
the JobServer and Proxy (traffic frequency will be reasonably high)
- it needs to be interoperable with java (is there PB for java?)
- each end of the connection should be able to register for and get
notifications from the other (e.g. Agent gives a heartbeat, JobServer
tells Agent to stop)
- sometimes the Proxy might be behind a firewall and only able to
connect out, we need to be able to use that connection to go back as
- we want to dynamically configure streaming connections between Proxies
Hopefully that's enough context for you to point at modules and tell
whether these are appropriate questions:
Can I re-use a TCP stream for multiple XML-RPC or PB operations?
If so, would it make sense to have the client (e.g. Proxy or Agent)
initiate the connection and then make a rpc (e.g. "notify me of
anything relevant") to the server which would eventually return when
something relevant came along - triggering a callback in the client...
wash, rinse, repeat?
Sorry if I'm overlooking something that already answers this, it
doesn't seem like something too unique to have not been asked
In science one tries to tell people, in such a way
as to be understood by everyone, something that
no one ever knew before. But in poetry, it's the
- Paul Dirac
>>>>> "Adriano" == Adriano Marques <py.adriano(a)gmail.com> writes:
Adriano> I have a twisted application, which formely was run with command
Adriano> line arguments which were used during runtime, eg: I was passing
Adriano> the path to the log file as argument. Then, I decided to make my
Adriano> app run through twistd as a tac file but then I'm not able to pass
Adriano> command line arguments anymore. Is there any way to overcome this
I also ran into this, and asked for some way to pass args but got told
(paraphrasing, from memory) that that's not the way to do it...
The way to do it seems to be to convert your application to be a Twisted
plugin. It's not too hard. Then you make sure there's a twisted/plugins
dir accessible from your path (with no __init__.py files in/under it). Then
twistd will find your plugin (just run twistd with no options and you
should see your plugin name listed at the bottom among the commands). Then
you can add options processing by subclassing the Options class in
Sorry to be so terse - no time. The above does work though, and seems to be
the Twisted way. Rough (untested) guideline code below.
from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from ???? import myservice
optFlags = [
['verbose', None, 'If True, be verbose.'],
optParameters = [
['port', 'p', '0', 'The port number to listen on.'],
# The tapname will appear in the output of twistd when run with no args.
# Use twistd -n my-plugin-name
# to invoke it.
tapname = 'my-plugin-name'
description = 'My snazzy service.'
options = Options
def makeService(self, options):
serviceMaker = MyServiceMaker()
I have a twisted application, which formely was run with command line
arguments which were used during runtime, eg: I was passing the path
to the log file as argument. Then, I decided to make my app run
through twistd as a tac file but then I'm not able to pass command
line arguments anymore. Is there any way to overcome this issue?
I'm running something like this:
$ twistd -y my_twisted_script.tac my_program_arguments
Then twistd is returning the following:
twistd: Unknown command: my_program_arguments
Adriano Monteiro Marques
"Don't stay in bed, unless you can make money in bed." - George Burns
I found twisted have a module called SIP which implements parts of
RFC3261, Session Initial Protocol.
As I am going to write an experimental SIP server, this module seems
to be very useful for me.
But, one problem : it's based on UDP.
I skimmed the code and I think maybe I can "Cut and Copy" some code of
this module to implement my own TCP SIP server.
But the idea of "cut and copy" is really annoying.
What will you do in my situation?
BTW, if you are going to write a protocol which supports both UDP and TCP,
what is your design going to be like?