[IPython-dev] Launchpad?

Glenn Tarbox, PhD glenn at tarbox.org
Sat Feb 9 19:51:28 EST 2008


On 2/9/08, Brian Granger <ellisonbg.net at gmail.com> wrote:
<snip>

> I have a patch I'll put together which integrates twisted with IPython
> > without polling... a slight hack starting with the ASPN code from way
> back.
> > There might be a much better approach given IPython1's direction but the
> > ASPN 1000hz polling loop didn't seem the way to go and I'm not sure I
> get
> > where IPython1 is yet.  I'll clean it up and send it in for opinions.
>
>
> I have done some work on this front this week and finally have a nice
> solution.  There are two pieces:
>
> 1.  I have created a simple class that runs the twisted reactor in the
> thread.


I think I took the other route... spawned the gtk / IPython thread off and
kept the main thread for twisted

def run(self):
        self.IP.mainloop()
        self.quitting = True
        self.IP.kill()

    def mainloop(self):
        # self.reactor.callLater(self.TIMEOUT, self.on_timer)
        def mainLoopThreadDeath(r):
            print "mainLoopThreadDeath: ", str(r)
        def spawnMainloopThread():
            d=threads.deferToThread(self.run)
            d.addBoth(mainLoopThreadDeath)
        reactor.callWhenRunning(spawnMainloopThread)
        self.reactor.run()
        print "mainloop ending...."

2.  The various parts of the twisted API can be called from ipython
> using a function that recently made it into the twisted trunk, called
> blockingCallFromThread.  This function is not in twisted 2.5.0, so I
> have put it into ipython1 until a new version of twisted is cut.


Interesting, I was under the impression (perhaps mistakenly) that
reactor.callFromThread() was blocking... actually, I think I've passed
return values through it... hmmm... need to go back and check on that.

This new arrangement is allowing us to develop very robust twisted
> based clients that work in regular python/ipython sessions.  This is a
> massive improvement over anything else we have had before.
>
> Here are the relevant classes in ipython1:
>
>
> http://ipython.scipy.org/ipython/ipython/browser/ipython1/branches/ipython1-client-r3021/ipython1/kernel/twistedutil.py
>
> These things are used here:
>
>
> http://ipython.scipy.org/ipython/ipython/browser/ipython1/branches/ipython1-client-r3021/ipython1/kernel/multiengineclient.py
>
> http://ipython.scipy.org/ipython/ipython/browser/ipython1/branches/ipython1-client-r3021/ipython1/kernel/client.py
>
> I should have this branch ready to merge into ipython1's trunk in a few
> days.
>
> Brian
>
> > --
>
> >
> > -glenn
> >
> > Glenn H. Tarbox, PhD
> > glenn at tarbox.org
> >
> >
> >
> > On 2/9/08, Ondrej Certik <ondrej at certik.cz> wrote:
> > > On Feb 9, 2008 1:08 PM, Gael Varoquaux <gael.varoquaux at normalesup.org>
> > wrote:
> > > > Hi,
> > > >
> > > > Pardon me, but you almost sound like a troll :->.
> > > >
> > > > Let me tell you why git is totally out of question. It works
> terribly
> > > > poorly under windows. Up to recently it did not work at all under
> > > > windows. Now it requires cygwin, and is terribly poorly integrated
> with
> > > > the system.
> > > >
> > > >
> > > > About Canonical reinventing the wheel with bzr. Well there might be
> more
> > > > than one solution to one problem. Git, hg and bzr have all had their
> > pros
> > > > and their cons. The DVCS is a young field, and different players
> have
> > > > tried different solutions. Currently the difference between hg and
> bzr
> > is
> > > > leveling off, as bzr is focusing on performance, and hg is focusing
> on
> > > > merge. Anyhow, I don't want to go in another endless hg vs bzr
> > discussion
> > > > (I don't mention git for the reasons given above). Bzr works very
> well
> > > > under windows, as one of its main developpers runs windows. I have
> > > > seen hg successfully used under windows. I have used both, and I
> know
> > > > both get the work done.
> > > >
> > > > I favor doing whatever gets the work done the easiest. It happens
> that
> > > > launchpad is a very convenient (though not perfect) web platform. I
> use
> > > > it for other projects, and I have been pleased not only by the
> current
> > > > features, but also by the features they keep adding. These guys
> listen
> > to
> > > > their users. Moreover, I want to stress that a choice taken now can
> be
> > > > revoked later. What matters is getting the work done!
> > > >
> > > > My 2 cents,
> > >
> > >
> > > You are right.
> > >
> > > Ondrej
> > >
> >
> >
> >
> >
> >
>
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev
> >
> >
>



-- 
-glenn (**** Note: New Number ***)

Glenn H. Tarbox, PhD
**** 206-494-0819 *** => New Number
glenn at tarbox.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20080209/503165e2/attachment.html>


More information about the IPython-dev mailing list