Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread L. Daniel Burr
Hi Jasper, On Wed, 24 Aug 2011 19:48:14 -0500, Jasper St. Pierre wrote: > Note that as far as I know, MochiKit isn't actively developed anymore. > Google's Closure has a fork of MochiKit's Deferred's, which seems to > incorporate some of Dojo's code as well. > > > http://code.google.com/p/

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Jasper St. Pierre
Note that as far as I know, MochiKit isn't actively developed anymore. Google's Closure has a fork of MochiKit's Deferred's, which seems to incorporate some of Dojo's code as well. http://code.google.com/p/closure-library/source/browse/trunk/third_party/closure/goog/mochikit/async/ On Wed, Aug

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Jasper, Allen, Richard, thanks all for the pointers. I am confused now;) No, seriously, I need to _test_ those libs, to see what they actually do. I.e. I suspect the "new Dojo Deferreds" with "then" return something different than the broken "then" in jQuery 1.5. This is all messy, personally,

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Richard Wall
On 25 August 2011 00:30, Tobias Oberstein wrote: > I am still wondering why they called the other stuff "then()" when it's not > then, but "also()" > and "pipe()" is the real ;) I agree. I had the same frustration a few months ago and various Twisted people pointed out missing features in Jquer

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Allen Short
My understanding (partially aided by this post: http://www.sitepen.com/blog/2010/05/03/robust-promises-with-dojo-deferred-1-5/) is that Dojo provides both twisted-style "addCallback" and CommonJS-style "then" methods. ___ Twisted-Python mailing list Twist

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Jasper St. Pierre
As far as I know, Dojo's Deferreds are a direct port of Twisted's. On Wed, Aug 24, 2011 at 7:30 PM, Tobias Oberstein wrote: > Found something: it seems in jQuery 1.6 they have introduced something which > corresponds > more closely to Twisted Deferreds callback/errback chains: > > //

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Found something: it seems in jQuery 1.6 they have introduced something which corresponds more closely to Twisted Deferreds callback/errback chains: // prints 23 sess.call("square", 23).pipe(function(res) { return sess.call("sqrt",

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Ok. This is most unpleasant. In particular since my options then are: 1) write my own, sane (Twisted like, which I think is the sane way) JS deferred, not use jQuery/CommonJS (which everyone else does) 2) open the door for users running into issues when they do both Twisted & JS/jQuery and don't

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Allen Short
No, this is something jQuery and CommonJS got wrong; callbacks don't chain in their implementation. Firing a jQuery promise invokes each callback in order with the same argument. Firing a Deferred in Twisted invokes the first callback then passes its return value as the arg to the next callback, a

[Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
I follow Glyphs advice and only keep the lambda version with standard Twisted Deferred. However, I've got a (I believe) more serious "design" problem. The RPC stuff works in Twisted, but also from JavaScript. So I have 2 audiences (Twisted and JS developers). On JS, I use the Deferreds that co

Re: [Twisted-Python] SFTP Server sample

2011-08-24 Thread Adi Roiban
On Wed, 2011-08-24 at 02:14 +, Osborn Chan wrote: > Hi Michal, > > Actually, I was running the example under root. (sudo) > I was able to list/put/get file for my non-root user after login. > However, listing (ls) doesn't work on top level directory (e.g. /home/ychan), > but it works fine any