Re: [Twisted-Python] Cred question

2010-08-05 Thread exarkun
On 4 Aug, 02:20 am, ss...@nextdigital.com wrote: >Hi, > >I am using Cred authentication system in my Nevow based web >application. > >Admin user can see list of all users from admin interface of the >application. > >Now, admin user wants to do following things: > >1. Automatically login as

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-05 Thread Alan Franzoni
On 8/4/10 1:30 PM, Pet wrote: > AFAIU this works only if Factory is subclassing > protocol.ServerFactory, XMLRPCFactory subclasses server.Site, where > protocol attribute is not present server.Site subclasses http.HTTPFactory which, in turns, subclasses protocol.ServerFactory: http://twistedmat

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-05 Thread Pet
On Thu, Aug 5, 2010 at 3:32 PM, Alan Franzoni wrote: > On 8/4/10 1:30 PM, Pet wrote: > >> AFAIU this works only if Factory is subclassing >> protocol.ServerFactory, XMLRPCFactory subclasses server.Site, where >> protocol attribute is not present > > server.Site subclasses  http.HTTPFactory which,

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-05 Thread Alan Franzoni
On 8/5/10 4:21 PM, Pet wrote: > what I've tried to do is to have objects, which were members of > XMLRPC. And these objects would have some internal state which is > isolated per request. But each new request has changed this objects, > because xmlrpc is created once and not for each request or con

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-05 Thread exarkun
On 02:21 pm, petshm...@googlemail.com wrote: On Thu, Aug 5, 2010 at 3:32 PM, Alan Franzoni wrote: On 8/4/10 1:30 PM, Pet wrote: AFAIU this works only if Factory is subclassing protocol.ServerFactory, XMLRPCFactory subclasses server.Site, where protocol attribute is not present server.Site su

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-05 Thread Pet
On Thu, Aug 5, 2010 at 5:01 PM, wrote: > On 02:21 pm, petshm...@googlemail.com wrote: >> >> On Thu, Aug 5, 2010 at 3:32 PM, Alan Franzoni wrote: >>> >>> On 8/4/10 1:30 PM, Pet wrote: AFAIU this works only if Factory is subclassing protocol.ServerFactory, XMLRPCFactory subclasses s

Re: [Twisted-Python] Cred question

2010-08-05 Thread Konrads Smelkovs
i guess he wants admin to 1) impersonate another user, akin to su -u anotheruser and 2) also to drop that user's session. For 1) you'd have to set the avatar to the user's id (or at application level implement something like effective uid). For 2) you'd have to iterate over all active sessions and

Re: [Twisted-Python] Configuring Twisted logging via plugins

2010-08-05 Thread Glyph Lefkowitz
On Aug 5, 2010, at 12:44 AM, Valeriy Zamarayev wrote: > Hello, all. > > There have been a few questions on this list about how to configure > Twisted logging via plugins, as opposed to .tac files. And we now know > about the #638 and #3534 tickets. Hopefully, they will be resolved > soon. > > Bu

Re: [Twisted-Python] Configuring Twisted logging via plugins

2010-08-05 Thread exarkun
On 05:25 pm, gl...@twistedmatrix.com wrote: >On Aug 5, 2010, at 12:44 AM, Valeriy Zamarayev wrote: >>Hello, all. >> >>There have been a few questions on this list about how to configure >>Twisted logging via plugins, as opposed to .tac files. And we now know >>about the #638 and #3534 tickets. Hope

[Twisted-Python] Get trial to use the docstring?

2010-08-05 Thread Nathan
Is there already a way to get twisted to print out a test's docstring (like unittest does) instead of the name of the function in it's output? I've looked at trial's options and searched the list archives, but I'm not seeing anything... For example, here's what my tests look like when run by unit

Re: [Twisted-Python] Configuring Twisted logging via plugins

2010-08-05 Thread Valeriy Zamarayev
On Aug 5, 2010, at 20:25, Glyph Lefkowitz wrote: > On Aug 5, 2010, at 12:44 AM, Valeriy Zamarayev wrote: >> >> See the code: http://gist.github.com/505926 >> >> This works for me. I don't know if a better and less dangerous way to >> achieve the same exists. Maybe there is one? > > > This actual

Re: [Twisted-Python] Get trial to use the docstring?

2010-08-05 Thread Glyph Lefkowitz
On Aug 5, 2010, at 2:33 PM, Nathan wrote: > Is there already a way to get twisted to print out a test's docstring > (like unittest does) instead of the name of the function in it's > output? I've looked at trial's options and searched the list > archives, but I'm not seeing anything... > > For e

Re: [Twisted-Python] service stops/twistd exits

2010-08-05 Thread Glyph Lefkowitz
On Aug 4, 2010, at 9:23 PM, Thomas Drake wrote: > Hello, > > I'm wondering if there is an established pattern for having an application > running in twistd shut itself down in the absence of a running service? > > The idea is that if a service fails it calls self.stopService() and the > appli

Re: [Twisted-Python] Get trial to use the docstring?

2010-08-05 Thread exarkun
On 07:08 pm, gl...@twistedmatrix.com wrote: >On Aug 5, 2010, at 2:33 PM, Nathan wrote: >>Is there already a way to get twisted to print out a test's docstring >>(like unittest does) instead of the name of the function in it's >>output? I've looked at trial's options and searched the list >>archive

Re: [Twisted-Python] Get trial to use the docstring?

2010-08-05 Thread Nathan
On Thu, Aug 5, 2010 at 1:49 PM, wrote: >>If you want to add a feature that prints out the docstring (or some >>portion of it) _in addition_ to the test name, that would probably be >>accepted as a patch.  But, in my mind, one of the most important >>features of trial is the fact that it prints ou

Re: [Twisted-Python] Cred question

2010-08-05 Thread Sury Soni
> i guess he wants admin to 1) impersonate another user, akin to su -u > anotheruser and 2) also to drop that user's session. > For 1) you'd have to set the avatar to the user's id (or at application level > implement something like effective uid). For 2) you'd have to iterate over all > active ses

Re: [Twisted-Python] Get trial to use the docstring?

2010-08-05 Thread Lucas Taylor
On 8/5/10 6:25 PM, Nathan wrote: > I have a number of questions: > > 1) I found the TreeReporter class that produces the default output > (twisted/trial/reporter.py), and I found the file that seems to get > run by trial (twisted/scripts/trial.py) but for the life of me I > couldn't figure out ho

[Twisted-Python] inlineCallbacks yield tuple support

2010-08-05 Thread Сергей Магафуров
This example shows what i want: @defer.inlineCallbacks def create_audio_link(tel, addr1, addr2): try: connection1, connection2 = yield (tel.connect(addr1), tel.connect(addr2)) except ConnectionError, exc: ... some error work ... else: return tel.create_audioli

[Twisted-Python] strange bug with... something :)

2010-08-05 Thread Сергей Магафуров
Example code 1 {{{ class Example(object): def __init__(self, connection): self.connection = connection self.counter = 0 self.requests = {} def generate_request_id(self): self.counter += 1 return self.counter def request(self, data, time