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've written a small python/twisted client library for CouchDB.
It's mostly a toy, but it can be fetched from here:
http://www.cs.aau.dk/~htj/code/couched-0.1.tar.gz if anyone is interested.
I'm aware of paisley (https://launchpad.net/paisley),
The main difference from paisley is that the connection and database
abstraction are separated.
Also couched does connection caching and uses web2 instead of web.
Currently paisley is more feature rich, but couched has slightly nicer error
line 763, in run
line 901, in _wait
We have a pretty big tests suite that uses trial to test all sorts of
twisted things. We are pretty careful to do the right thing in our
tests and leave the reactor clean....but recently we began seeing a
transient really wierd bug when we run our test suite.
Some characteristics of the problem:
1. The problem only appears sometimes - seems random
2. The problem shows up in different test methods
3. Sometimes it hangs the tests suite for a long time - eventually
twisted continues though
Here is the traceback we get.
line 220, in run
line 228, in mainLoop
--- <exception caught here> ---
line 533, in runUntilCurrent
line 261, in errback
line 290, in _startRunCallbacks
It appears that something is going on in the deadly _wait. Any
thoughts on how we might fix this?
I have been trying to figure out how to use the twisted.internet.pollreactor so that I can use it to monitor a Linux named PIPE (i.e. a FIFO created using mkfifo()). I tried without success to Google some examples but I couldn't find anything.
Now, for a simple TCP server, the setup looks something like this (i.e. like the QOTD example in the documentation):
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
self.transport.write("An apple a day keeps the doctor away\r\n")
# Next lines are magic:
factory = Factory()
factory.protocol = QOTD
# 8007 is the port you want to run under. Choose something >1024
So, the TCP type of reactor has something that tells it to listen to port 8007 and use some form of factory or object to take care of things when a connection occurs. As far as I can guess, I would need to do some steps like this (NOTE: using mixture of real and pseudo code):
from twisted.internet import pollreactor
<create a FileDescriptor object using /tmp/myfifo, maybe a class?>
<use the reactor.addReader() call to register the FileDescriptor object with the reactor>
<call reactor.run() (no loop) or call reactor.doPoll() (in a loop, processing returned events)?>
Anyways, if anyone can give me some direction on how this reactor works. Ideally, I would assume that the relationships would be somewhat like this:
Protocol analogous to FileDescriptor
reactor.listenTCP analogous to reactor.addReader()
reactor.run() would invoke the appropriate call in my FileDescriptor-based class to handle any read events on /tmp/myfifo
Thanks in advance.
Here's the problem : I need to run a windows executable (proprietary,
they won't give us the code) with wine to do some audio compression. I
need to do different processing before (like calling sox, or parsing
files, etc) so I wrote some functions that do everything. The windows
exec creates a tmp file named "_tmp" in the working dir, so if I want to
run several in parallel, I have to create a tmp dir with a unique name
and change the working dir, if not then the multiple executions will
overwrite each other's tmp file. So when I call my function that does
the whole process, I first create a tmp dir, then pass it the tmp dir
and the input filename, then once inside the function, it does an
os.chDir() into the tmp dir and at the end it does it again to go back
to the original current dir. Then I run that function in threads. The
problem is that threads share the current dir :
so I need to use processes instead, as they each have their own current
dir. The thing is that from what I understand, Twisted's process API is
intended to be used with external executables only, correct? I wasn' t
able to fins anything that allowed me to do stuff like I would using
fork(). Should I just use python's fock() instead? Is it safe with Twisted?