Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > Cześć Cześć! :) Thank you for your answer. I'm explicitly interested in the following combination: > .addCallback(cb).addErrback(eb) If I understand correctly errback "eb" catches errors from both callback "cb", and from agent.request (agent.request errors pass through default empty

Re: [Twisted-Python] Is there a 'development mode ' for twisted ?

2013-09-05 Thread Laurens Van Houtven
On Thu, Sep 5, 2013 at 1:54 AM, a qi wrote: > HI, there > > I'm new to twisted, after reading the documents from twisted > websites, I got some questions: > > 1. Is there a 'development mode ' for twisted ? like django, you > can see your changes without restarting server. > Not

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Laurens Van Houtven
Hi, On Thu, Sep 5, 2013 at 9:24 AM, Maciej Wasilak wrote: > Thank you for your answer. I'm explicitly interested in the following > combination: > > > .addCallback(cb).addErrback(eb) > > If I understand correctly errback "eb" catches errors from both callback > "cb", and from agent.request (age

Re: [Twisted-Python] Asynchronously reading posted data

2013-09-05 Thread Paul Wiseman
Hey, Thanks for your reply! The json data should never be too long so I'm not worried about the memory usage, I need the whole json object to start working anyway realistically - I was more concerned about blocking reading the data from the network - specifically the request.content.read(), if the

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > You don't have to do it from in there. You can do > .addErrback(handleErrors, request), since it's all the same request object, > right? > Aaargh! I see the problem now. I wrote everything as part of the Protocol class (D&D - Deferreds&Dictionaries), when I should have extracted reque

Re: [Twisted-Python] Can't check elements without uri in twisted.words.xish.domish.Element

2013-09-05 Thread Ralph Meijer
On 2013-09-04 16:43, Goffi wrote: > G'day, > > in the method "elements" of twisted.words.xish.domish.Element, the > function "generateElementsQNamed" is called event if the uri if None, so > the uri is checked against None instead of not checked at all. > > I think the function "generateElementsN

Re: [Twisted-Python] Asynchronously reading posted data

2013-09-05 Thread exarkun
On 08:50 am, poal...@gmail.com wrote: Hey, Thanks for your reply! The json data should never be too long so I'm not worried about the memory usage, I need the whole json object to start working anyway realistically - I was more concerned about blocking reading the data from the network - spec

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Laurens Van Houtven
On Thu, Sep 5, 2013 at 12:00 PM, Maciej Wasilak wrote: > Laurens, > > >> You don't have to do it from in there. You can do >> .addErrback(handleErrors, request), since it's all the same request object, >> right? >> > > Aaargh! I see the problem now. I wrote everything as part of the Protocol > c

Re: [Twisted-Python] Asynchronously reading posted data

2013-09-05 Thread Paul Wiseman
Ah awesome that clears it up, thanks! I've never had to deal with HTTP requests with content bodies before. I presumed that the .read() would be pulling bytes from the network. I presumed wrong :) Thanks! Paul On 5 September 2013 12:24, wrote: > On 08:50 am, poal...@gmail.com wrote: > >> Hey

Re: [Twisted-Python] ftpclient connection lost callback

2013-09-05 Thread exarkun
On 05:49 pm, pe...@peterryan.net wrote: I am writing a simple ftp client which I am trying to dispose of. Right now I send a quit command: (the ftp_client reference is a FTPClient built with a ClientCreator) deferred = ftp_client.quit() And I register a callback: def quitSent(response): pr

[Twisted-Python] ftpclient connection lost callback

2013-09-05 Thread Peter Ryan
I am writing a simple ftp client which I am trying to dispose of. Right now I send a quit command: (the ftp_client reference is a FTPClient built with a ClientCreator) deferred = ftp_client.quit() And I register a callback: def quitSent(response): print "quit acknowledged...connected?", ftp_

Re: [Twisted-Python] ftpclient connection lost callback

2013-09-05 Thread exarkun
On 06:48 pm, pe...@peterryan.net wrote: Thanks. So is the idiomatic approach for this with something like the FTPClient to subclass it and override connectionLost? FTPClientBasic clears up queued commands when this happens (which I assume I still want it to do). Is it idiomatic? I don't kn

Re: [Twisted-Python] ftpclient connection lost callback

2013-09-05 Thread Peter Ryan
Thanks. So is the idiomatic approach for this with something like the FTPClient to subclass it and override connectionLost? FTPClientBasic clears up queued commands when this happens (which I assume I still want it to do). To me it seems a little overbearing to have to subclass the ftpclient just