From thorsten at thorstenkampe.de Sun Apr 1 11:57:16 2007 From: thorsten at thorstenkampe.de (Thorsten Kampe) Date: Sun, 1 Apr 2007 16:57:16 +0100 Subject: [IPython-dev] bug in coloured prompt References: Message-ID: * Thorsten Kampe (Wed, 28 Mar 2007 22:30:25 +0100) > [IPython 0.7.3 and 0.7.4] > > Hi, > > "\#" (maybe other special escapes, too) ignores the colour escape codes > in prompts. See for instance [1]. The "\#" is printed in green (although > it should be white. Same goes for the out prompt where it's printed in > red. > > Thorsten > [1] prompt_in1 '\C_White[\#\C_White]\C_LightCyan>>> ' Can someone confirm that this is a bug? From fperez.net at gmail.com Sun Apr 1 16:54:20 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 1 Apr 2007 14:54:20 -0600 Subject: [IPython-dev] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/1/07, Thorsten Kampe wrote: > * Thorsten Kampe (Wed, 28 Mar 2007 22:30:25 +0100) > > [IPython 0.7.3 and 0.7.4] > > > > Hi, > > > > "\#" (maybe other special escapes, too) ignores the colour escape codes > > in prompts. See for instance [1]. The "\#" is printed in green (although > > it should be white. Same goes for the out prompt where it's printed in > > red. > > > > Thorsten > > [1] prompt_in1 '\C_White[\#\C_White]\C_LightCyan>>> ' > > Can someone confirm that this is a bug? Well, it's more of a design limitation, or a not-implemented feature than a 'oops, little bug we missed' kind of thing. The original coloring code, when I wrote it, hardcoded a color scheme for certain items. The templates that handle coloring perform this expansion: r'\#' : '${self.col_num}' '${self.cache.prompt_count}' '${self.col_p}', With self.col_num being hardcoded in the color tables defined in Prompts.py. These are, at this point, not really user-extensible in any convenient way. Having a cleaner way for users to define their own color schemes is certainly on the ToDo list, and we'll visit it when we split out the I/O code. In the meantime, you can work around the problem by using the raw prompt number object instead of the \# escape: prompt_in1 '\C_White[${self.cache.prompt_count}\C_White]\C_LightCyan>>> ' self.cache.prompt_count is the prompt counter, so instead of \# you can abuse the API a little bit this way. But if you update to SVN, I just added a new prompt escape, \N which is identical to \# but does NOT apply any coloring. Using \N instead of \# lets you then apply your own colors at will. While this isn't a real overhaul of the coloring system (we're too close to a release for that), I think this minimally intrusive change is sufficient for most purposes, since the prompt number was the only object that was automatically wrapped in hardcoded coloring. Technically the entire prompt string gets wrapped also, but that doesn't matter since the first manually-issued color escape will override that; the number was problematic because the internal escape would always win, as you discovered. I hope this is enough for your needs, since it's as much as I can do this close to a release. And thanks for the report! Regards, f From fperez.net at gmail.com Mon Apr 2 02:09:19 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 2 Apr 2007 00:09:19 -0600 Subject: [IPython-dev] New mailing lists for SVN commits and Trac tickets Message-ID: Howdy, thanks to R. Kern and Jeff Strunk (from Enthought) we now have mailing lists that automatically generate messages when there are commits to SVN (including diffs) and activity on Track tickets: http://lists.ipython.scipy.org/mailman/listinfo/ipython-svndiff http://lists.ipython.scipy.org/mailman/listinfo/ipython-tickets Anyone is obviously free to sign up, but I'd like to especially encourage the devs to be on at the very least the tickets one, so we don't miss activity there for lack of checking the site. If you have a good RSS-based workflow you're happy with, using the Trac timeline RSS feed, just feel free to ignore the suggestion. Cheers, f From fperez.net at gmail.com Mon Apr 2 02:29:47 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 2 Apr 2007 00:29:47 -0600 Subject: [IPython-dev] [IPython-user] New mailing lists for SVN commits and Trac tickets In-Reply-To: References: Message-ID: On 4/2/07, Robert Kern wrote: > There is also a list for SVN commits with just a summary and not the diffs > (which can sometimes be rather large). Thanks, somehow I missed that one. Fixed the Moin wiki as well. Cheers, f From fperez.net at gmail.com Mon Apr 2 18:03:10 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 2 Apr 2007 16:03:10 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/2/07, Thorsten Kampe wrote: > * Thorsten Kampe (Mon, 2 Apr 2007 08:59:15 +0100) > > By the way (introducing a new bug(?): if I run Cygwin IPython (meaning > > "Linux" Python and GNU readline) the output prompt shows the colour > > escape sequences as coloured faces. This only happens with the > > standard Windows console and the well-known "Console"[1]. > > > > The paradox thing is that prompt_in1 and prompt_in2 display fine - > > it's just prompt_out that has this mistake. Is there some special code > > in IPython that constructs the in prompts differently than the out > > prompt?! Yes, the input prompts use InputTermColors; see ColorAnsi.py: http://projects.scipy.org/ipython/ipython/browser/ipython/trunk/IPython/ColorANSI.py Perhaps those terminals, under windows, misinterpret escapes that don't have the extra \001/\002 bracketing them. Note that getting coloring to work at all under windows has been a long and painful road (given the sorry status of terminal programs in that platform), so I'm not terribly surprised to see there are still problems. We're too close to a release to change this in the trunk, but at least knowing this, you can make a local change to test if adding those escapes improves things for you. If it does, with more time for testing it could be applied everywhere as a win32-specific change, but not now. Cheers, f From fperez.net at gmail.com Tue Apr 3 01:44:05 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 2 Apr 2007 23:44:05 -0600 Subject: [IPython-dev] Different behaviour: python vs. ipython when using a C module In-Reply-To: References: Message-ID: Hi Stefan, On 10/16/06, Stefan Reich?r wrote: > "Fernando Perez" writes: > > I realize it works in pure python, so I'd be inclined to say it's an > > ipython bug: ipython should always let you do things that are valid > > python. But I honestly don't know what the solution is here, nor even > > if it's not a fluke that it works for the pure python case. > > > > I'll be glad to fix this one if we could understand better the > > problem, so if anyone knows what's going on, by all means pitch in. > > I don't know anything about ther ipython internals. But the error > message suggests, that the import functionality is not available > for C extensions, when using ipython. unfortunately, today I'm no closer to knowing what to do with this bug than back in October. But I did open a ticket on it: http://projects.scipy.org/ipython/ipython/ticket/139 so that at least we don't forget about it altogether. If you have any flash of insight that might help here, by all means let me know. Regards, f From fperez.net at gmail.com Tue Apr 3 01:51:34 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 2 Apr 2007 23:51:34 -0600 Subject: [IPython-dev] [FWD] IPythonShellEmbed() disturbs regular (embedded) Python traceback In-Reply-To: <45439E4C.9040100@colorado.edu> References: <45439E4C.9040100@colorado.edu> Message-ID: Hi Remy, > # ORIGINAL MESSAGE: > I am embedding Python in one of my C apps, and use IPythonShellEmbed > to support an interactive Python shell, using > > if( !called ){ > PyRun_SimpleString( "from IPython.Shell import IPythonShellEmbed" ); > PyRun_SimpleString( "xgraph.ipshell=IPythonShellEmbed()" ); > PyRun_SimpleString( "xgraph.ipshell.set_banner('Entering > xgraph.ipshell IPython shell')" ); > PyRun_SimpleString( "xgraph.ipshell.set_exit_msg('Leaving > xgraph.ipshell IPython shell')" ); > // Not clear if this is needed or actually does anything: > PyRun_SimpleString( "xgraph.ipshell.restore_system_completer()" ); > called= 1; > } > > > If I call this upon initialising the embedded interpreter, (some) > syntax errors in user code no longer generate useful error messages: > > def RedrawNow: > return None > > --------------------------------------------------------------------------- > None Traceback (most recent call last) > > > None: None > > > If I do *not* initialise the interactive shell, I get the usual message > > def RedrawNow: > return None > > File "", line 1 > def RedrawNow: > ^ > SyntaxError: invalid syntax > > > This is of course quite annoying: execution of the Python code stops > at the offending statement, but there is no way to find out what that > statement was. > > To be honest, I don't see why IPython would become active outside an > eventual call to xgraph.ipshell() as defined above...?! Sorry for the ridiculously long delay, this had just fallen to the bottom of my pile... Unfortunately I have to admit I don't know at this moment what the problem is. But in order to ensure that we don't lose track of this problem again, I made a ticket on it: http://projects.scipy.org/ipython/ipython/ticket/140 Feel free to let us know if you have any thoughts on the solution. Regards, f From fperez.net at gmail.com Tue Apr 3 13:03:12 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 3 Apr 2007 11:03:12 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/3/07, Thorsten Kampe wrote: > Where would I have to make the change? In class TermColors? Yes, try to make it similar to InputTermColors and see what happens. Cheers, f From fperez.net at gmail.com Wed Apr 4 00:14:22 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 3 Apr 2007 22:14:22 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/3/07, Thorsten Kampe wrote: > * Fernando Perez (Tue, 3 Apr 2007 11:03:12 -0600) > > On 4/3/07, Thorsten Kampe wrote: > > > Where would I have to make the change? In class TermColors? > > > > Yes, try to make it similar to InputTermColors and see what happens. > > Oooooops, it's actually the other way round: if I remove the \001/\002 > from "class InputTermColors" then the outprompt (and the inprompts > still, too) looks fine. Ah, OK. > My conclusion: readline may use those \001 \002 to "properly know the > length of each line and can wrap lines accordingly" but some Windows > terminals can't interpret them (or they don't ignore them like they > should or readline doesn't "eat" them like it should). > > Now the question is: why do Windows cmd and Console together with > Cygwin Python and readline have a problem with those "\001 \002" pairs > and why do Windows cmd and Console together with Windows Python and > pyreadline not?! I don't know. If I was in a snotty mood, I'd say that the bug is not /in/ Windows, but that Windows /IS/ the bug. But that would be mean :) We do have enough Win32 users that if you can find a patch that makes all combinations of terminals and environments under win32 work correctly, I'm sure it will be very welcome. Note that if you remove those escapes, then very long lines (that reach the end of the terminal) start wrapping incorrectly and badly misbehaving. So if you change anything there, make sure you do lots of interactive tests with very long lines, recalling them in history, trying to re-edit them, etc. And also, any patch for this should be *strictly* confined to win32, since all terminals work fine under *nix in all its flavors (as far as I know). Cheers, f From thorsten at thorstenkampe.de Wed Apr 4 04:59:52 2007 From: thorsten at thorstenkampe.de (Thorsten Kampe) Date: Wed, 4 Apr 2007 09:59:52 +0100 Subject: [IPython-dev] [IPython-user] bug in coloured prompt References: Message-ID: * Fernando Perez (Tue, 3 Apr 2007 22:14:22 -0600) > On 4/3/07, Thorsten Kampe wrote: > > * Fernando Perez (Tue, 3 Apr 2007 11:03:12 -0600) > > > On 4/3/07, Thorsten Kampe wrote: > > > > Where would I have to make the change? In class TermColors? > > > > > > Yes, try to make it similar to InputTermColors and see what happens. > > > > Oooooops, it's actually the other way round: if I remove the \001/\002 > > from "class InputTermColors" then the outprompt (and the inprompts > > still, too) looks fine. > > Ah, OK. > > > My conclusion: readline may use those \001 \002 to "properly know the > > length of each line and can wrap lines accordingly" but some Windows > > terminals can't interpret them (or they don't ignore them like they > > should or readline doesn't "eat" them like it should). > > > > Now the question is: why do Windows cmd and Console together with > > Cygwin Python and readline have a problem with those "\001 \002" pairs > > and why do Windows cmd and Console together with Windows Python and > > pyreadline not?! > > I don't know. > > If I was in a snotty mood, I'd say that the bug is not /in/ Windows, > but that Windows /IS/ the bug. But that would be mean :) Yes, and incorrect. I guess it's a readline issue (even though rxvt doesn't have the problem) because the Windows Terminals work fine with "your" pyreadline. > We do have enough Win32 users that if you can find a patch that makes > all combinations of terminals and environments under win32 work > correctly, I'm sure it will be very welcome. To be honest I don't think a patch to IPython would make sense. Other applications have the same problem (lftp and yafc for instance) - and probably the same cause for the problem. It wouldn't make sense to patch all these apps. The only thing these applications have in common is that they use Cygwin readline. I guess we have to patch readline. > And also, any patch for this should be *strictly* confined to win32, > since all terminals work fine under *nix in all its flavors (as far as > I know). Win32 is fine, really. The "OS" (sys.platform) in question is Cygwin. Thorsten From fperez.net at gmail.com Wed Apr 4 12:36:35 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 4 Apr 2007 10:36:35 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/4/07, Thorsten Kampe wrote: > > If I was in a snotty mood, I'd say that the bug is not /in/ Windows, > > but that Windows /IS/ the bug. But that would be mean :) > > Yes, and incorrect. I guess it's a readline issue (even though rxvt > doesn't have the problem) because the Windows Terminals work fine with > "your" pyreadline. Well, it works fine *now*, after enormous amounts of time were spent on accomodating their limitations. One reason I'm particularly allergic to win32 is because it has cost us (and mostly others than myself, but I've spent my fair share in the past) a lot of effort to get the most basic ANSI terminal support that ipython needs working under Windows terminals. So they may work today, but not exactly thanks to windows being any good, believe me. If it weren't for Gary Bishop (original pyreadline author) and Jorgen, today we'd still have the old message saying "ipython works under windows, but in a very limited fashion, without coloring or much line editing support of any kind". > > We do have enough Win32 users that if you can find a patch that makes > > all combinations of terminals and environments under win32 work > > correctly, I'm sure it will be very welcome. > > To be honest I don't think a patch to IPython would make sense. Other > applications have the same problem (lftp and yafc for instance) - and > probably the same cause for the problem. It wouldn't make sense to > patch all these apps. The only thing these applications have in common > is that they use Cygwin readline. I guess we have to patch readline. Well, IPython already has tons of workaround code to make sure users get the right experience even in the face of limitations in third-party code (bugs in python itself, windows, etc.). So I would not be against including something similar to help here, if it can be made robustly. But obviously if you can have Cygwin fixed for good, that's even better :) Regards, f From gael.varoquaux at normalesup.org Wed Apr 4 15:02:11 2007 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Wed, 4 Apr 2007 21:02:11 +0200 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: <20070404190211.GC23970@clipper.ens.fr> On Wed, Apr 04, 2007 at 10:36:35AM -0600, Fernando Perez wrote: > Well, it works fine *now*, after enormous amounts of time were spent > on accomodating their limitations. One reason I'm particularly > allergic to win32 is because it has cost us (and mostly others than > myself, but I've spent my fair share in the past) a lot of effort to > get the most basic ANSI terminal support that ipython needs working > under Windows terminals. So they may work today, but not exactly > thanks to windows being any good, believe me. If it weren't for Gary > Bishop (original pyreadline author) and Jorgen, today we'd still have > the old message saying "ipython works under windows, but in a very > limited fashion, without coloring or much line editing support of any > kind". I think what this really tells us is that we need a front-end independant ipython that can come with a wxPython front-end and therefore be useable under windows with all this PITA. I guess this is coming with ipython1 ? I am sure there is some work to do with this but I am to busy with other things to offer some help. Ga?l From fperez.net at gmail.com Wed Apr 4 15:41:16 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 4 Apr 2007 13:41:16 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: <20070404190211.GC23970@clipper.ens.fr> References: <20070404190211.GC23970@clipper.ens.fr> Message-ID: On 4/4/07, Gael Varoquaux wrote: > I think what this really tells us is that we need a front-end independant > ipython that can come with a wxPython front-end and therefore be useable > under windows with all this PITA. I guess this is coming with ipython1 ? > I am sure there is some work to do with this but I am to busy with other > things to offer some help. Yes, that's precisely coming. I even already have R. Kern's mercurial repository of something along these lines that he hacked together to work on WX, and it has nicely spelled out list of constraints for clean WX integration. Obviously, as you can imagine, the goal is to make it trivial to have a true ipython console inside Envisage. It won't happen tomorrow, but it will happen :) Cheers, f From jorgen.stenarson at bostream.nu Wed Apr 4 17:38:11 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Wed, 04 Apr 2007 23:38:11 +0200 Subject: [IPython-dev] test new pyreadline version Message-ID: <46141AC3.5010707@bostream.nu> Hi all, it would be great if some people could try out the new version of pyreadline. That is the new trunk version that now lives in svn at http://ipython.scipy.org/svn/ipython/pyreadline/trunk I think it is best to check it out in a new directory and not try to update if you have used the older trunk version. You will probably want to upgrade your configuration file to enable new interesting features: - Keyboard selection for copy/paste - Control-c can be used for copy (not enabled by default because it eats KeyboardInterupts) - It can even be made to run on ironpython with a bit of patching of ironpython. It works quite well for me on my machine but I exepect there are a few rough edges that will become apparent by other peoples use. So please test it and let me know what you find. Unfortunately I will be gone on a business trip most of next week, so I think a joint release with the new ipython version will be difficult to achieve. /J?rgen From fperez.net at gmail.com Wed Apr 4 17:57:08 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 4 Apr 2007 15:57:08 -0600 Subject: [IPython-dev] test new pyreadline version In-Reply-To: <46141AC3.5010707@bostream.nu> References: <46141AC3.5010707@bostream.nu> Message-ID: On 4/4/07, J?rgen Stenarson wrote: > Hi all, > > it would be great if some people could try out the new version of > pyreadline. That is the new trunk version that now lives in svn at > http://ipython.scipy.org/svn/ipython/pyreadline/trunk > > I think it is best to check it out in a new directory and not try to > update if you have used the older trunk version. > > You will probably want to upgrade your configuration file to enable new > interesting features: > - Keyboard selection for copy/paste > - Control-c can be used for copy (not enabled by default because it eats > KeyboardInterupts) > - It can even be made to run on ironpython with a bit of patching of > ironpython. > > It works quite well for me on my machine but I exepect there are a few > rough edges that will become apparent by other peoples use. So please > test it and let me know what you find. > > Unfortunately I will be gone on a business trip most of next week, so I > think a joint release with the new ipython version will be difficult to > achieve. Is it as simple as python setup.py bdist_wininst ? I just did and I got this: http://ipython.scipy.org/dist/testing/pyreadline-1.4.svn.win32.exe If this is what you need, I'll be happy to make it available on the main dist/ directory when we get 0.7.4 out the door. If you can leave the release announcement written, I'll merge it with the main one and we can make a joint release. It doesn't really add much at all to my workload, so I have no problem doing it if that's OK with you. Cheers, f From fperez.net at gmail.com Thu Apr 5 02:13:05 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 00:13:05 -0600 Subject: [IPython-dev] Testers requested - 0.7.4.rc1, with async cross-thread exceptions Message-ID: Hi all, one glaring limitation of our multithreaded shells is the unfortunate lack of support for Ctrl-C, so you can't interrupt a long computation with any of the multithreaded shells. Well, it seems I may have actually got it: http://projects.scipy.org/ipython/ipython/changeset/2216 The changelog has more info. This would be a really major improvement to IPython, but I am only cautiously optimistic. It requires ctypes to work. I would *greatly* appreciate if others could test current SVN with this. Try hitting Ctrl-C in all kinds of situations, with long running code, with matplotlib, etc. In order to get the widest possible testing, I just made and uploaded RC1 for 0.7.4 to: http://ipython.scipy.org/dist/testing/ If the multithreaded async exception support turns out not to work, it's (deliberately) a single, self-contained patch that I can easily revert and we're otherwise good to go on all pending tickets and items in my todo list for 0.7.4. So, those of you on *nix/Python2.4 who want to help, please remember to install ctypes first. Win32 users already had it (it's needed for pyreadline), and Python2.5 ships with it. Thanks to all for any testing help you can provide! Regards, f ps - If this really works, we owe a big thanks to Tomer Filiba (http://sebulba.wikispaces.com/recipe+thread2) for the basic underlying trick that makes this possible at all. I'd heard about the mythical PyThreadState_SetAsyncExc undocumented call in the Python C API, but if it weren't for his recipe, I probably would never had gotten this. From erendisaldarion at gmail.com Thu Apr 5 12:50:46 2007 From: erendisaldarion at gmail.com (Aldarion) Date: Fri, 06 Apr 2007 00:50:46 +0800 Subject: [IPython-dev] Testers requested - 0.7.4.rc1, with async cross-thread exceptions In-Reply-To: References: Message-ID: <461528E6.8050802@gmail.com> I install ipython0.74rc1 (On windows server 2003 with sp2)? it works with pyreadline1.3 ,but can't find pyreadline1.4-svn and if i run "c:\Python25\python.exe c:\Python25\scripts\ipython -Xthread" it return a warn(maybe a error, i think): WARNING: Error in Arguments: "Illegal option '-Xthread'" I use the binary (exe) of ipython0.74rc1 and pyreadline1.4-svn From fperez.net at gmail.com Thu Apr 5 12:54:39 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 10:54:39 -0600 Subject: [IPython-dev] Testers requested - 0.7.4.rc1, with async cross-thread exceptions In-Reply-To: <461528E6.8050802@gmail.com> References: <461528E6.8050802@gmail.com> Message-ID: On 4/5/07, Aldarion wrote: > I install ipython0.74rc1 (On windows server 2003 with sp2)? > it works with pyreadline1.3 ,but can't find pyreadline1.4-svn > and if i run "c:\Python25\python.exe c:\Python25\scripts\ipython -Xthread" > it return a warn(maybe a error, i think): > WARNING: > Error in Arguments: "Illegal option '-Xthread'" -Xthread is not a valid option, the valid ones are (copying from the help page): -gthread, -qthread, -q4thread, -wthread, -pylab Only ONE of these can be given, and it can only be given as the first option passed to IPython (it will have no effect in any other position). They provide threading support for the GTK, QT and WXWidgets toolkits, and for the matplotlib library. With any of the first four options, IPython starts running a separate thread for the graphical toolkit's operation, so that you can open and control graphical elements from within an IPython command line, without blocking. All four provide essentially the same functionality, respectively for GTK, QT3, QT4 and WXWidgets (via their Python interfaces). Note that with -wthread, you can additionally use the -wxversion option to request a specific version of wx to be used. This requires that you have the 'wxversion' Python module installed, which is part of recent wxPython distributions. If -pylab is given, IPython loads special support for the mat- plotlib library (http://matplotlib.sourceforge.net), allowing interactive usage of any of its backends as defined in the user's .matplotlibrc file. It automatically activates GTK, QT or WX threading for IPyhton if the choice of matplotlib backend requires it. It also modifies the %run command to correctly execute (without blocking) any matplotlib-based script which calls show() at the end. I'm not sure about the pyreadline problem, I hope more experienced win32 users can help here. Jorgen is out of town for a few days though, so we won't hear from him quite yet. Thanks for the feedback, f From erendisaldarion at gmail.com Thu Apr 5 13:34:03 2007 From: erendisaldarion at gmail.com (Aldarion) Date: Fri, 06 Apr 2007 01:34:03 +0800 Subject: [IPython-dev] Testers requested - 0.7.4.rc1, with async cross-thread exceptions In-Reply-To: References: <461528E6.8050802@gmail.com> Message-ID: <4615330B.8050507@gmail.com> o, i got below from [Enthought-dev] maillist """ a release candidate for IPython 0.7.4, as well as PyReadline (needed by windows users). There is one new feature in this release which is of particular interest here: the ability to hit Ctrl-C to interrupt a long-running script or computation, even when using any of the multithreaded shells. This should work whether you started ipython with -Xthread support or with -pylab ""' It seems I misunderstand the "-Xthread" in it, it should represent one of -gthread or -qthread or .... thanks for you info and sorry for my bad English. Fernando Perez wrote: > On 4/5/07, Aldarion wrote: >> I install ipython0.74rc1 (On windows server 2003 with sp2)? >> it works with pyreadline1.3 ,but can't find pyreadline1.4-svn >> and if i run "c:\Python25\python.exe c:\Python25\scripts\ipython >> -Xthread" >> it return a warn(maybe a error, i think): >> WARNING: >> Error in Arguments: "Illegal option '-Xthread'" > > -Xthread is not a valid option, the valid ones are (copying from the > help page): > > -gthread, -qthread, -q4thread, -wthread, -pylab > > Only ONE of these can be given, and it can only be given as the > first option passed to IPython (it will have no effect in any > other position). They provide threading support for the GTK, QT > and WXWidgets toolkits, and for the matplotlib library. > > With any of the first four options, IPython starts running a > separate thread for the graphical toolkit's operation, so that > you can open and control graphical elements from within an > IPython command line, without blocking. All four provide > essentially the same functionality, respectively for GTK, QT3, > QT4 and WXWidgets (via their Python interfaces). > > Note that with -wthread, you can additionally use the -wxversion > option to request a specific version of wx to be used. This > requires that you have the 'wxversion' Python module installed, > which is part of recent wxPython distributions. > > If -pylab is given, IPython loads special support for the mat- > plotlib library (http://matplotlib.sourceforge.net), allowing > interactive usage of any of its backends as defined in the > user's .matplotlibrc file. It automatically activates GTK, QT > or WX threading for IPyhton if the choice of matplotlib backend > requires it. It also modifies the %run command to correctly > execute (without blocking) any matplotlib-based script which > calls show() at the end. > > > > I'm not sure about the pyreadline problem, I hope more experienced > win32 users can help here. Jorgen is out of town for a few days > though, so we won't hear from him quite yet. > > Thanks for the feedback, > > f > From mpmusu at cc.usu.edu Thu Apr 5 14:17:01 2007 From: mpmusu at cc.usu.edu (Mark.Miller) Date: Thu, 05 Apr 2007 12:17:01 -0600 Subject: [IPython-dev] Ipython1/python24/python25 Message-ID: <46153D1D.1020701@cc.usu.edu> Greetings: Is the saw branch of Ipython1 being developed with python25 in mind? Also, how close is 'saw' to being ready for release? Thanks, -Mark From fperez.net at gmail.com Thu Apr 5 14:18:04 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 12:18:04 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/5/07, Thorsten Kampe wrote: > I now received an answer from Eric Blake, the Cygwin readline > maintainer. Basically he says that the Prompt code in IPython (and the > other applications that have the problem) is buggy. Here's his main > statement: > > > In other words, the common bug in all three programs you mentioned > > is that they copied bash's escape sequences, but NOT bash's round of > > internal expansion, prior to calling readline. > > [...] > > Just because most other terminals (rxvt, xterm, ...) are tolerant of > > unknown control characters, and treat spurious invisible \001 as > > non-printing characters, doesn't mean that lftp, yafc, or IPython > > should assume that all terminals behave that way. > > Could you have a look at this and see whether he's right or wrong? Even without looking, there's a very good chance he's right, for the simple reason that he probably knows what he's talking about, while I don't :) Seriously, I know about the low-level details of readline and ANSI terminals as little as possible, and what I learned was just the minimum necessary to hack the code into behaving on all terminals I had access to. So from a 'purity' standpoint, it's *very* likely that what I'm doing is highly dubious. However, it has the minor merit of actually working on most terminals (cygwin excepted). If anyone can send us patches that are more correct from the readline/ANSI perspective, while simultaneously keeping the current user-visible correct behavior on all the terminals we work on (konsole, gnome-terminal, rxvt, xterm, OSX Terminal, OSX X11 xterm, Win32 cmd terminal, probably more), I'm all for it. Note that the behavior with very long lines, wrapping and history needs to be checked everywhere as well. If in addition such a patch happens to also fix the Cygwin issue, even better! Regards, f From fperez.net at gmail.com Thu Apr 5 14:20:08 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 12:20:08 -0600 Subject: [IPython-dev] Ipython1/python24/python25 In-Reply-To: <46153D1D.1020701@cc.usu.edu> References: <46153D1D.1020701@cc.usu.edu> Message-ID: On 4/5/07, Mark.Miller wrote: > > Greetings: > > Is the saw branch of Ipython1 being developed with python25 in mind? It doesn't *require* 2.5, but it works fine with it. The minimum required version is 2.4. > Also, how close is 'saw' to being ready for release? Early next week, most likely. Brian will handle that: I've been helping him behind the scenes a bit, but I'm mostly focusing on the trunk release right now. Cheers, f From fperez.net at gmail.com Thu Apr 5 16:54:59 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 14:54:59 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/6/07, Thorsten Kampe wrote: > I would like to urge you strongly to consider having a look at the > thread mentioned (or at least at Eric's reply). I did. Looking at that thread for a moment doesn't mean that I magically have the time to work on this issue, unfortunately. My time for ipython development is already highly constrained as it is, and we have *much* bigger fish to fry right now, so the unfortunate reality is that for me, this is very much a back-burner issue. But if you can't contribute a patch yourself, I encourage you to file a ticket for this issue in our bug tracker: http://projects.scipy.org/ipython/ipython This will ensure that the matter is not forgotten, and it increases the chance that another developer or user may read about it, understand the details and provide a viable solution. I don't want to sound dismissive: I'd *like* to have a solid solution for this. But given how *today* it only affects a sub-platform (cygwin under win32, and perhaps only with some terminals), that I don't even have that platform installed at all, and that I have tons of other issues to deal with that are far more pressing, I'm afraid the solution will simply not come from me. But if it comes from anyone else, we'll be very happy to incorporate it, that's for sure. Regards, f From fperez.net at gmail.com Thu Apr 5 17:56:06 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 15:56:06 -0600 Subject: [IPython-dev] Release plans... Message-ID: Hi all, I've been heavily using the thread support with async exceptions, and everything looks good so far. Furthermore, the combined -Xthread -tk (or -pylab -tk) is also working wonders under Ubuntu, so that you can keep Wx/GTK/Qt windows alive coexisting with Tk ones. This is critical for me, since it lets me use Mayavi1 (a Tk app) along with the better Matplotlib backends (like Wx) and the Enthought tools (all Wx based). All simultaneously. So far this hasn't crashed, locked up or otherwise misbehaved, so I'm cautiously optimistic. I would then like to draft up a quick plan for release: 1. If anyone has any pending issues they feel *need* to be addressed *now*, speak up. File a ticket, target it to the 0.7.4 milestone, and we'll do our best. I cleared all existing tickets and everything I had in my inbox. 2. If we get good feedback of this feature, I'd like to release next Monday or Tuesday. I have a trip at the end of the week, so Tuesday is my cutoff date. 3. If the async exception feature holds the beating, I'd like to release as 0.8.0. For a certain class of users, this is actually a big deal and a significant change in behavior. It's also worth noting that our changes since 0.7.3 haven't exactly been small: planck[ipython]> svn diff -r"{2006-12-20}" | wc -l 22955 and we have lots of other new features, goodies and bugfixes. I don't think anyone can accuse ipython of version number inflation, with 5+ years to reach 0.7.x :) Let me know of any feedback you may have on these points, otherwise I'll proceed for a Tuesday release of 0.8.0 without any major changes from the current RC (I have a few tiny local changes). And please, if you can, beat on that Ctrl-C+threads feature and let me know how it goes. Also, if anyone knows how to identify the main thread ID with cleaner code than this ugly hack: def _set_main_thread_id(): """Ugly hack to find the main thread's ID. """ global MAIN_THREAD_ID for tid, tobj in threading._active.items(): # There must be a better way to do this than looking at the str() for # each thread object... if 'MainThread' in str(tobj): #print 'main tid:',tid # dbg MAIN_THREAD_ID = tid break let me know. There has to be one... Thanks! f From danmil at comcast.net Thu Apr 5 18:48:07 2007 From: danmil at comcast.net (Dan Milstein) Date: Thu, 5 Apr 2007 18:48:07 -0400 Subject: [IPython-dev] Release plans... In-Reply-To: References: Message-ID: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> F- In terms of 0.7.4 v 0.8 -- would it make sense to fold in my reorg of the prefilter stuff in that case? I mean, on the one hand, no, because we're close and all, and who wants to introduce a chunk of new code now. OTOH, as it's becoming, as you say, a non-trivial update (in particular, there are a bunch of changes to prefilter stuff which I need to track), so why not put in cleaned up code + all the tests. What do you think? -D On Apr 5, 2007, at 5:56 PM, Fernando Perez wrote: > Hi all, > > I've been heavily using the thread support with async exceptions, and > everything looks good so far. Furthermore, the combined > > -Xthread -tk (or -pylab -tk) > > is also working wonders under Ubuntu, so that you can keep Wx/GTK/Qt > windows alive coexisting with Tk ones. This is critical for me, since > it lets me use Mayavi1 (a Tk app) along with the better Matplotlib > backends (like Wx) and the Enthought tools (all Wx based). All > simultaneously. > > So far this hasn't crashed, locked up or otherwise misbehaved, so I'm > cautiously optimistic. > > I would then like to draft up a quick plan for release: > > 1. If anyone has any pending issues they feel *need* to be addressed > *now*, speak up. File a ticket, target it to the 0.7.4 milestone, and > we'll do our best. I cleared all existing tickets and everything I > had in my inbox. > > 2. If we get good feedback of this feature, I'd like to release next > Monday or Tuesday. I have a trip at the end of the week, so Tuesday > is my cutoff date. > > 3. If the async exception feature holds the beating, I'd like to > release as 0.8.0. For a certain class of users, this is actually a > big deal and a significant change in behavior. It's also worth noting > that our changes since 0.7.3 haven't exactly been small: > > planck[ipython]> svn diff -r"{2006-12-20}" | wc -l > 22955 > > and we have lots of other new features, goodies and bugfixes. I don't > think anyone can accuse ipython of version number inflation, with 5+ > years to reach 0.7.x :) > > > Let me know of any feedback you may have on these points, otherwise > I'll proceed for a Tuesday release of 0.8.0 without any major changes > from the current RC (I have a few tiny local changes). > > > And please, if you can, beat on that Ctrl-C+threads feature and let me > know how it goes. > > Also, if anyone knows how to identify the main thread ID with cleaner > code than this ugly hack: > > def _set_main_thread_id(): > """Ugly hack to find the main thread's ID. > """ > global MAIN_THREAD_ID > for tid, tobj in threading._active.items(): > # There must be a better way to do this than looking at the > str() for > # each thread object... > if 'MainThread' in str(tobj): > #print 'main tid:',tid # dbg > MAIN_THREAD_ID = tid > break > > let me know. There has to be one... > > > Thanks! > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev From fperez.net at gmail.com Thu Apr 5 18:57:39 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 16:57:39 -0600 Subject: [IPython-dev] Release plans... In-Reply-To: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> References: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> Message-ID: On 4/5/07, Dan Milstein wrote: > F- > > In terms of 0.7.4 v 0.8 -- would it make sense to fold in my reorg of > the prefilter stuff in that case? I mean, on the one hand, no, > because we're close and all, and who wants to introduce a chunk of > new code now. OTOH, as it's becoming, as you say, a non-trivial > update (in particular, there are a bunch of changes to prefilter > stuff which I need to track), so why not put in cleaned up code + all > the tests. > > What do you think? Time is my problem right now. As I mentioned, next week I'm leaving for a python workshop and I need to finish testing a big binary build effort for that, as well as preparing the workshop materials and 2 talks. So swamped doesn't begin to describe where I am right now, unfortunately :) Since it would basically mean almost blind-dumping that code with no chance of testing it, I'm reluctant. I'd much rather get 0.8.0 on Tuesday and immediately commit your code for 0.8.1. That release could come soon, and that will be the code base we'll use for the Boulder Sprint, and which we'll pull into the saw branch for the future. I hate to put you on hold, given your contributions. But I hope you understand the constraints... Regards, f From danmil at comcast.net Thu Apr 5 19:01:09 2007 From: danmil at comcast.net (Dan Milstein) Date: Thu, 5 Apr 2007 19:01:09 -0400 Subject: [IPython-dev] Release plans... In-Reply-To: References: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> Message-ID: <6914BB3F-C87C-462F-89E6-AF60F6779884@comcast.net> > Since it would basically mean almost blind-dumping that code with no > chance of testing it, I'm reluctant. Agreed. I want it to get a solid review. > I'd much rather get 0.8.0 on Tuesday and immediately commit your code > for 0.8.1. That release could come soon, and that will be the code > base we'll use for the Boulder Sprint, and which we'll pull into the > saw branch for the future. That sounds excellent. I think that was my fear -- that the next release would be a long way off, and the refactoring might get lost (and I would forget how it worked ;-). The above sounds great. > I hate to put you on hold, given your contributions. But I hope you > understand the constraints... No worries. Very much appreciate the quick response. -D From fperez.net at gmail.com Thu Apr 5 19:12:26 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 17:12:26 -0600 Subject: [IPython-dev] Release plans... In-Reply-To: <6914BB3F-C87C-462F-89E6-AF60F6779884@comcast.net> References: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> <6914BB3F-C87C-462F-89E6-AF60F6779884@comcast.net> Message-ID: On 4/5/07, Dan Milstein wrote: > > Since it would basically mean almost blind-dumping that code with no > > chance of testing it, I'm reluctant. > > Agreed. I want it to get a solid review. > > > I'd much rather get 0.8.0 on Tuesday and immediately commit your code > > for 0.8.1. That release could come soon, and that will be the code > > base we'll use for the Boulder Sprint, and which we'll pull into the > > saw branch for the future. > > That sounds excellent. I think that was my fear -- that the next > release would be a long way off, and the refactoring might get lost > (and I would forget how it worked ;-). The above sounds great. We have a plan then. > > I hate to put you on hold, given your contributions. But I hope you > > understand the constraints... > > No worries. Very much appreciate the quick response. My pleasure. Please rebase your patches once 0.8.0 is out and feel free to send them my way. Regarding http://projects.scipy.org/ipython/ipython/ticket/52 I just applied this to my local tree: Index: test_prefilter.py =================================================================== --- test_prefilter.py (revision 2218) +++ test_prefilter.py (working copy) @@ -145,7 +145,7 @@ ( '?thing', handle_help, ), ( 'thing?', handle_help ), # '?' can trail... ( 'thing!', handle_normal), # but only '?' can trail - ( '!thing?', handle_help), # trailing '?' wins if more than one + ( '!thing?', handle_shell_escape), # trailing '?' wins if more than one ( ' ?thing', handle_help), # ignore leading whitespace ( '!ls', handle_shell_escape ), ( '%magic', handle_magic), I think that's the correct test in light of Stefan's patches and the behavior we want, no? I'll commit later with a few other minor thingies. Cheers, f From fperez.net at gmail.com Thu Apr 5 19:18:38 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 17:18:38 -0600 Subject: [IPython-dev] [IPython-user] Release plans... In-Reply-To: <20070405230542.GA18196@mentat.za.net> References: <20070405230542.GA18196@mentat.za.net> Message-ID: On 4/5/07, Stefan van der Walt wrote: > Indulge another stupid question from my side, please. Is this piece > of code run from the main thread itself, or is it used in different > threads? Why can't a person simply place > > import thread > MAIN_THREAD_ID = thread.get_ident() > > at the top of Shell.py? Because I know even less about threads than you do, that's why :) > Yes, I know I show how little I know of threading, but now's as good a > time as any to learn. Your fix seems to work just fine, thanks. I hacked that yesterday in a rush, and didn't even read any docs at all. I figured there HAD to be an API for this. I'll test further on my local copy, and commit later with a few other things I've piled up here. Thanks!! best, f From danmil at comcast.net Thu Apr 5 19:18:55 2007 From: danmil at comcast.net (Dan Milstein) Date: Thu, 5 Apr 2007 19:18:55 -0400 Subject: [IPython-dev] Release plans... In-Reply-To: References: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> <6914BB3F-C87C-462F-89E6-AF60F6779884@comcast.net> Message-ID: <70F66989-7C51-4F51-9A76-6565E6C10CE6@comcast.net> > > I just applied this to my local tree: > > Index: test_prefilter.py > =================================================================== > --- test_prefilter.py (revision 2218) > +++ test_prefilter.py (working copy) > @@ -145,7 +145,7 @@ > ( '?thing', handle_help, ), > ( 'thing?', handle_help ), # '?' can trail... > ( 'thing!', handle_normal), # but only '?' can trail > - ( '!thing?', handle_help), # trailing '?' wins if more > than one > + ( '!thing?', handle_shell_escape), # trailing '?' wins if > more than one > ( ' ?thing', handle_help), # ignore leading whitespace > ( '!ls', handle_shell_escape ), > ( '%magic', handle_magic), > > > I think that's the correct test in light of Stefan's patches and the > behavior we want, no? Yep, that's correct -- and I've actually added a whole set of further tests in my private copy to ensure that it does the right thing for all trailing qmark / leading esc char combos: # Trailing qmark combos. Odd special cases abound ( '!thing?', handle_shell_escape), # trailing '?' loses to shell esc ( '!thing ?', handle_shell_escape), ( '!!thing?', handle_shell_escape), ( '%cmd?', handle_help), ( '/cmd?', handle_help), ( ';cmd?', handle_help), ( ',cmd?', handle_help), -D From fperez.net at gmail.com Thu Apr 5 19:23:14 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 5 Apr 2007 17:23:14 -0600 Subject: [IPython-dev] Release plans... In-Reply-To: <70F66989-7C51-4F51-9A76-6565E6C10CE6@comcast.net> References: <06AB5B98-4D9B-42BA-A019-63E92791EF2D@comcast.net> <6914BB3F-C87C-462F-89E6-AF60F6779884@comcast.net> <70F66989-7C51-4F51-9A76-6565E6C10CE6@comcast.net> Message-ID: On 4/5/07, Dan Milstein wrote: > Yep, that's correct -- and I've actually added a whole set of further > tests in my private copy to ensure that it does the right thing for > all trailing qmark / leading esc char combos: > > # Trailing qmark combos. Odd special cases abound > ( '!thing?', handle_shell_escape), # trailing '?' loses to > shell esc > ( '!thing ?', handle_shell_escape), > ( '!!thing?', handle_shell_escape), > ( '%cmd?', handle_help), > ( '/cmd?', handle_help), > ( ';cmd?', handle_help), > ( ',cmd?', handle_help), OK, here's the current diff then after applying these: Index: test_prefilter.py =================================================================== --- test_prefilter.py (revision 2218) +++ test_prefilter.py (working copy) @@ -145,8 +145,15 @@ ( '?thing', handle_help, ), ( 'thing?', handle_help ), # '?' can trail... ( 'thing!', handle_normal), # but only '?' can trail - ( '!thing?', handle_help), # trailing '?' wins if more than one ( ' ?thing', handle_help), # ignore leading whitespace + # Trailing qmark combos. Odd special cases abound + ( '!thing?', handle_shell_escape), # trailing '?' loses to shell esc + ( '!thing ?', handle_shell_escape), + ( '!!thing?', handle_shell_escape), + ( '%cmd?', handle_help), + ( '/cmd?', handle_help), + ( ';cmd?', handle_help), + ( ',cmd?', handle_help), ( '!ls', handle_shell_escape ), ( '%magic', handle_magic), # Possibly, add test for /,; once those are unhooked from %autocall I'll do a commit later tonight. Thanks! f From fperez.net at gmail.com Fri Apr 6 12:53:55 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 6 Apr 2007 10:53:55 -0600 Subject: [IPython-dev] [IPython-user] bug in coloured prompt In-Reply-To: References: Message-ID: On 4/6/07, Thorsten Kampe wrote: > I still think that the problem could be quite simple. Just one more > question and I will stop nagging and being a PITA: > > 1. Does IPython wrap the colour prompt > a) just in a single "\001invisible\002plain" or > b) in something like "\001\001invisible\001\002plain"? > > 2. If b) then where does that happen in the source code? See http://projects.scipy.org/ipython/ipython/browser/ipython/trunk/IPython/ColorANSI.py#L87 the code is: else: Normal = '\001\033[0m\002' # Reset normal coloring _base = '\001\033[%sm\002' # Template for all other colors This is a template, where *each* ANSI escape is expanded (that's the %s part) to form actual color schemes (that code comes right after). This module builds the classes for color handling, and the explicit color schemes are built where needed (see Prompts.py for prompt colors, excolors for exception colors and PyColorize for source highlihting colors). Regards, f From fperez.net at gmail.com Sat Apr 7 19:46:26 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 7 Apr 2007 17:46:26 -0600 Subject: [IPython-dev] PyReadline install is completely broken Message-ID: Hi Jorgen, you may want to work a bit on the setup.py: after you refactored pyreadline, you didn't do anything at all with setup.py, and currently it's completely broken. You can see for yourself by running setup.py sdist and then unpacking the resulting tarball. This is all it contains: tlon[pyreadline-1.4.svn]> d /home/fperez/ipython/svn/pyreadline/dist/pyreadline-1.4.svn total 20 -rw-r--r-- 1 fperez 1280 2007-04-07 17:03 PKG-INFO drwxr-xr-x 2 fperez 4096 2007-04-07 17:03 pyreadline/ -rw-r--r-- 1 fperez 194 2007-04-04 15:54 readline.py -rw-r--r-- 1 fperez 46 2007-02-28 12:54 setup.cfg -rw-r--r-- 1 fperez 1339 2007-04-04 15:54 setup.py tlon[pyreadline-1.4.svn]> d pyreadline/ /home/fperez/ipython/svn/pyreadline/dist/pyreadline-1.4.svn total 44 -rw-r--r-- 1 fperez 496 2007-04-04 15:54 error.py -rw-r--r-- 1 fperez 474 2007-04-04 15:54 get_doc.py -rw-r--r-- 1 fperez 1106 2007-04-04 15:54 __init__.py -rw-r--r-- 1 fperez 1166 2007-04-04 15:54 logger.py -rw-r--r-- 1 fperez 1319 2007-04-04 15:54 logserver.py -rw-r--r-- 1 fperez 2439 2007-04-04 15:54 release.py -rw-r--r-- 1 fperez 17231 2007-04-04 15:54 rlmain.py tlon[pyreadline-1.4.svn]> I noticed when I tried to reproduce the reported post-install bug reported by N. Pernetty, and installing your pyreadline gave a crazy ipython crash at startup. Win32 users can still run 0.8.0 with their current pyreadline 1.3, and upgrade to 1.4 when you get a chance to fix the installer. Cheers, f From fperez.net at gmail.com Sat Apr 7 23:01:54 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 7 Apr 2007 21:01:54 -0600 Subject: [IPython-dev] Front page and pyreadline one locked down on wiki Message-ID: Hi all, I locked down these pages in the wiki: http://ipython.scipy.org/moin http://ipython.scipy.org/moin/PyReadline/Intro so that only the people listed here: http://ipython.scipy.org/moin/EditorsGroup can write to them. These pages were getting regularly defaced by spammers, and I just got tired of it. Note that it's NOT my intent to close them to community editing, so pretty much anyone who wants to edit them, just ask here and I'll add you to that list (in particular Jorgen for the readline one, I just don't have your wiki ID). I don't imagine any spammer will have the gall to ask in person for permission and then go to deface a page :) If more pages become spammer targets I'll lock them down as well, let's just hope this doesn't become necessary. So far only these two were being regularly attacked, probably because they rank higher in common searches. cheers, f From fperez.net at gmail.com Wed Apr 11 01:14:43 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 10 Apr 2007 23:14:43 -0600 Subject: [IPython-dev] [ANN] IPython 0.8.0 is out In-Reply-To: References: Message-ID: Hi all, The IPython team is happy to release version 0.8.0, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? ---------------- 1. An interactive shell superior to Python's default. IPython has many features for object introspection, system shell access, and its own special command system for adding functionality when working interactively. 2. An embeddable, ready to use interpreter for your own programs. IPython can be started with a single call from inside another program, providing access to the current namespace. 3. A flexible framework which can be used as the base environment for other systems with Python as the underlying language. 4. A shell for interactive usage of threaded graphical toolkits. IPython has support for interactive, non-blocking control of GTK, Qt and WX applications via special threading flags. The normal Python shell can only do this for Tkinter applications. Where to get it --------------- IPython's homepage is at: http://ipython.scipy.org and downloads are at: http://ipython.scipy.org/dist We've provided: - Source download (.tar.gz) - A Python Egg (http://peak.telecommunity.com/DevCenter/PythonEggs). - A python 2.4 RPM. - A native win32 installer. The egg is 'light', as it doesn't include documentation and other ancillary data. If you want a full ipython installation, use the source tarball or your distribution's favorite system. We note that IPython is now officially part of most major Linux and BSD distributions, so packages for this version should be coming soon, as the respective maintainers have the time to follow their packaging procedures. Many thanks to the distribution packagers for their work, which helps users get IPython more conveniently. Thanks to all the users who contributed bug reports, ideas and especially patches. The ChangeLog has hopefully detailed acknowledgements, but please let us know if we've accidentally ommitted giving you due credit. Many thanks to Enthought for their continued hosting support for IPython. Release notes ------------- As always, the full ChangeLog is at http://ipython.scipy.org/ChangeLog. The highlights of this release follow. Also see the "What's New" page at http://ipython.scipy.org/moin/WhatsNew * Support for KeyboardInterrupt (Ctrl-C) when running in multithreaded mode with GUI support. This had been a long-requested feature that we had never quite been able to implement correctly. Many thanks to Tomer Filiba's for his ctypes-based trick: http://sebulba.wikispaces.com/recipe+thread2, which we used (any implementation mistakes are our own and not his fault). Users of Python 2.4 should note that they need to install ctypes separately to access this feature; ctypes is part of Python 2.5 already. * Fully syntax-highlighted tracebacks and debugger listings. IPython used to color tracebacks, but only certain elements; now the source is actually highlighted by the same engine that handles '??' source listings, both in tracebacks and during interactive debugging. * Improved the ipipe system: http://ipython.scipy.org/moin/UsingIPipe, including a new WX-based graphical browser. * Much improved unicode support. There may still be bugs remaining, but a number of known-incorrect cases have been fixed. * Make the execution of 'from pylab import *' when -pylab is given be otional. A new flag (which can be set in your ipythonrc file), pylab_import_all controls this behavior, the default is True for backwards compatibility. * Extensions for perforce support via a new magic (%p4) and custom command completers. * Improved support for (X)Emacs under win32. * Several small fixes and improvements to the interactive demo module. * Add \N for the actual prompt number, without any coloring, as an escape for customized prompt definitions. This lets users write their own custom prompts with arbitrary coloring schemes. * Many more bugfixes and small features everywhere (the ChangeLog linked above has the gory details). API changes: * genutils.clock() now returns user+system time. The new clocku/clocks functions return respectively user and system time only. Enjoy, and as usual please report any problems. The IPython team. From tocer.deng at gmail.com Wed Apr 11 04:59:56 2007 From: tocer.deng at gmail.com (tocer) Date: Wed, 11 Apr 2007 16:59:56 +0800 Subject: [IPython-dev] error in ipython 0.8 Message-ID: <461CA38C.5060401@gmail.com> Hi, I have install ipython0.8 just now. When I run a python script in ipython, a error occor: C:\Python24\Lib\site-packages\IPython\iplib.py in reloadhist(self) 1255 1256 if self.has_readline: -> 1257 self.readline.clear_history() 1258 self.readline.read_history_file(self.shell.histfile) 1259 AttributeError: 'module' object has no attribute 'clear_history' Winxp + IPython0.8 + pyreadline1.3 thank your gread job. cheers From erendisaldarion at gmail.com Wed Apr 11 05:26:10 2007 From: erendisaldarion at gmail.com (Aldarion) Date: Wed, 11 Apr 2007 17:26:10 +0800 Subject: [IPython-dev] error in ipython 0.8 In-Reply-To: <461CA38C.5060401@gmail.com> References: <461CA38C.5060401@gmail.com> Message-ID: <461CA9B2.4050201@gmail.com> same error here, windows server 2003,IPython0.8 + pyreadline1.3 (+ python2.5) and: IPtyhon 0.73/0.74rc1 works fine with pyreadline1.3 IPython 0.73/0.74rc1 can't load pyreadline1.4svn Ipython 0.80 failed load pyreadline1.4svn (can't stop printing a lot of error info...) tocer wrote: > Hi, > > I have install ipython0.8 just now. When I run a python script in ipython, a > error occor: > > C:\Python24\Lib\site-packages\IPython\iplib.py in reloadhist(self) > 1255 > 1256 if self.has_readline: > -> 1257 self.readline.clear_history() > 1258 self.readline.read_history_file(self.shell.histfile) > 1259 > > AttributeError: 'module' object has no attribute 'clear_history' > > Winxp + IPython0.8 + pyreadline1.3 > > thank your gread job. > > cheers > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > From fperez.net at gmail.com Wed Apr 11 09:28:23 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 07:28:23 -0600 Subject: [IPython-dev] error in ipython 0.8 In-Reply-To: <461CA9B2.4050201@gmail.com> References: <461CA38C.5060401@gmail.com> <461CA9B2.4050201@gmail.com> Message-ID: On 4/11/07, Aldarion wrote: > same error here, > windows server 2003,IPython0.8 + pyreadline1.3 (+ python2.5) > and: > IPtyhon 0.73/0.74rc1 works fine with pyreadline1.3 > IPython 0.73/0.74rc1 can't load pyreadline1.4svn > Ipython 0.80 failed load pyreadline1.4svn (can't stop printing a lot > of error info...) ARGH: I didn't realize (since my windows box died completely and I couldn't test there) that 0.8.0 relies on the API from pyreadline 1.4. But pyreadline 1.4 isn't out yet because Jorgen has been busy this week: there's a problem with its setup.py file that creates an incomplete installer. For now, the only solution is for win32 users to NOT upgrade. I'll be gone on travel for a few days, but I can sneak into the server to upload pyreadline as soon as Jorgen (or anyone else who can test on win32) updates its setup.py file to produce a proper installer. I moved the win32 installer out of the way (to testing/) for now. Huge apology about this. Regards, f From fperez.net at gmail.com Wed Apr 11 09:34:27 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 07:34:27 -0600 Subject: [IPython-dev] Windows users: do NOT upgrade to 0.8.0 yet! Message-ID: Hi all unless you are using pyreadline from SVN, if you are a Windows user, do NOT upgrade to ipython 0.8.0 yet. As we unfortunately discovered this morning, it needs pyreadline 1.4, which we haven't released yet because Jorgen is on travel and the current code has a broken setup.py. I'm sure that as soon as Jorgen returns (or any other dev with Windows access for testing can do it) we'll sort this out, and we'll release PyReadline 1.4. At that time, it will be safe to upgrade. If any user can contribute a fixed up setup.py for pyreadline, I'll be happy to incorporate it and release (I can make the release from Linux). Unfortunatley I have a trip coming up and can't spend any time on the issue myself beyond making a release, I simply don't have time to write the code myself right now. Next Wednesday would be the earliest I could do the coding, though making the release is quick enough that I can do it if someone sends a patch for the setup file (which seems to be the only problem). I'm very sorry for the confusion and the time wasted for all. My Windows install lives on a computer that died (hardware) this weekend so I couldn't do any testing, and our win32 developers who regularly work on the platform (Jorgen and Ville) have both been traveling, so I completely dropped the ball for that OS. My apology. Regards, f From fperez.net at gmail.com Wed Apr 11 10:30:01 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 08:30:01 -0600 Subject: [IPython-dev] Win32 - call for pyreadline testing Message-ID: Hi all, This was a bit too embarrassing to let it go. http://ipython.scipy.org/dist/ now contains an upload of pyreadline 1.4 for windows. I can NOT test whether this works at all, I just did a quick fix of the setup.py on my linux box and uploaded the binary installer after checking that the .tar.gz looks reasonable. If anyone can test and confirm that things work now, I can remove the warnings from the site. I also uploaded the fixes to SVN... thanks, and sorry again. f From erendisaldarion at gmail.com Wed Apr 11 11:25:26 2007 From: erendisaldarion at gmail.com (Aldarion) Date: Wed, 11 Apr 2007 23:25:26 +0800 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: Message-ID: <461CFDE6.30204@gmail.com> Hello, I Install ipython 0.8.0 and pyreadline1.4 (win2003 python2.5) However, there is still the error: Maybe something is abnormal. """ In [2]: run foo.py just test --------------------------------------------------------------------------- Traceback (most recent call last) C:\Documents and Settings\Administrator\Desktop\note\ in () C:\Python25\Lib\site-packages\IPython\iplib.py in ipmagic(self, arg_s) 955 else: 956 magic_args = self.var_expand(magic_args,1) --> 957 return fn(magic_args) 958 959 def ipalias(self,arg_s): C:\Python25\Lib\site-packages\IPython\Magic.py in magic_run(self, parameter_s, r unner) 1674 if restore_main: 1675 sys.modules['__main__'] = restore_main -> 1676 self.shell.reloadhist() 1677 1678 return stats C:\Python25\Lib\site-packages\IPython\iplib.py in reloadhist(self) 1255 1256 if self.has_readline: -> 1257 self.readline.clear_history() 1258 self.readline.read_history_file(self.shell.histfile) 1259 : 'module' object has no attribute 'clear_hist ory' """ Fernando Perez wrote: > Hi all, > > This was a bit too embarrassing to let it go. > > http://ipython.scipy.org/dist/ > > now contains an upload of pyreadline 1.4 for windows. > > I can NOT test whether this works at all, I just did a quick fix of > the setup.py on my linux box and uploaded the binary installer after > checking that the .tar.gz looks reasonable. > > If anyone can test and confirm that things work now, I can remove the > warnings from the site. > > I also uploaded the fixes to SVN... > > thanks, and sorry again. > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > From cbc at unc.edu Wed Apr 11 11:55:34 2007 From: cbc at unc.edu (Chris Calloway) Date: Wed, 11 Apr 2007 11:55:34 -0400 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: <461CFDE6.30204@gmail.com> References: <461CFDE6.30204@gmail.com> Message-ID: <461D04F6.3000109@unc.edu> Aldarion wrote: > Hello, I Install ipython 0.8.0 and pyreadline1.4 (win2003 python2.5) > However, there is still the error: > Maybe something is abnormal. > """ > In [2]: run foo.py > just test > --------------------------------------------------------------------------- > Traceback (most recent call last) > > [...snip...] Same here. I notice no _ipython is being created. And if I try to run a script from the command line, it becomes an IndexError instead of an AttributeError: C:\>C:\Python25\python.exe C:\Python25\scripts\ipython "\Documents and Settings\cbcoasis\Desktop\test.py" --------------------------------------------------------------------------- Traceback (most recent call last) : tuple index out of range WARNING: Failure executing file: <\Documents and Settings\cbcoasis\Desktop\test.py> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.8.0 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 From erendisaldarion at gmail.com Wed Apr 11 12:31:49 2007 From: erendisaldarion at gmail.com (Aldarion) Date: Thu, 12 Apr 2007 00:31:49 +0800 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: <461D04F6.3000109@unc.edu> References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> Message-ID: <461D0D75.80507@gmail.com> I have modify some place as follows: 1, add 'clear_history',to __all__ dict of c:\python25\lib\site-packages\pyreadline\__init__.py before 'read_history_file', 2, in file c:\python25\lib\site-packages\pyreadline\rlmain.py add clear_history = rl.clear_history before read_history_file = rl.read_history_file add a function of Class Readline before def read_history_file(self, filename=None): def clear_history(self): ''''Clear readline's history''' self._history.clear_history() 3,in file c:\python25\lib\site-packages\pyreadline\lineeditor\history.py add a function of Class LineHistory before def read_history_file(self, filename=None): def clear_history(self): ''''Clear readline's history''' self.history = [] self.history_cursor = 0 and the error disappears. Chris Calloway wrote: > Aldarion wrote: >> Hello, I Install ipython 0.8.0 and pyreadline1.4 (win2003 python2.5) >> However, there is still the error: >> Maybe something is abnormal. >> """ >> In [2]: run foo.py >> just test >> --------------------------------------------------------------------------- >> >> Traceback (most recent call >> last) >> >> [...snip...] > > Same here. I notice no _ipython is being created. And if I try to run > a script from the command line, it becomes an IndexError instead of an > AttributeError: > > C:\>C:\Python25\python.exe C:\Python25\scripts\ipython "\Documents and > Settings\cbcoasis\Desktop\test.py" > --------------------------------------------------------------------------- > > Traceback (most recent call > last) > > > : tuple index out of range > WARNING: Failure executing file: <\Documents and > Settings\cbcoasis\Desktop\test.py> > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] > Type "copyright", "credits" or "license" for more information. > > IPython 0.8.0 -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: __init__.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: history.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rlmain.py URL: From fperez.net at gmail.com Wed Apr 11 13:20:50 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 11:20:50 -0600 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: <461D0D75.80507@gmail.com> References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: On 4/11/07, Aldarion wrote: > I have modify some place as follows: > 1, add 'clear_history',to __all__ dict of > c:\python25\lib\site-packages\pyreadline\__init__.py before > 'read_history_file', > 2, in file c:\python25\lib\site-packages\pyreadline\rlmain.py > add clear_history = rl.clear_history before read_history_file = > rl.read_history_file > add a function of Class Readline before def read_history_file(self, > filename=None): > def clear_history(self): > ''''Clear readline's history''' > self._history.clear_history() > 3,in file c:\python25\lib\site-packages\pyreadline\lineeditor\history.py > add a function of Class LineHistory before def read_history_file(self, > filename=None): > def clear_history(self): > ''''Clear readline's history''' > self.history = [] > self.history_cursor = 0 > and the error disappears. Yup, my mistake. I just added a slightly modified version of your fixes and uploaded pyreadline 1.4.1 here: http://ipython.scipy.org/dist/ If others can confirms this works fine, we may be finally in the clear. Many thanks for your help, and again my apologies to users (and Jorgen!) for making such a mess on win32. Regards, f From erendisaldarion at gmail.com Wed Apr 11 13:36:40 2007 From: erendisaldarion at gmail.com (aldarion) Date: Thu, 12 Apr 2007 01:36:40 +0800 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: It looks the definition line of two function(clear_history of rlmain and history) miss a space(it should be four and now is three, and the function body lack one space too) and the function (clear_history) maybe responsible for the ' exceptions.AttributeError', there is still the IndexError error as Chris Calloway'said, no clue here On 4/12/07, Fernando Perez wrote: > > On 4/11/07, Aldarion wrote: > > I have modify some place as follows: > > 1, add 'clear_history',to __all__ dict of > > c:\python25\lib\site-packages\pyreadline\__init__.py before > > 'read_history_file', > > 2, in file c:\python25\lib\site-packages\pyreadline\rlmain.py > > add clear_history = rl.clear_history before read_history_file = > > rl.read_history_file > > add a function of Class Readline before def read_history_file(self, > > filename=None): > > def clear_history(self): > > ''''Clear readline's history''' > > self._history.clear_history() > > 3,in file c:\python25\lib\site-packages\pyreadline\lineeditor\history.py > > add a function of Class LineHistory before def read_history_file(self, > > filename=None): > > def clear_history(self): > > ''''Clear readline's history''' > > self.history = [] > > self.history_cursor = 0 > > and the error disappears. > > Yup, my mistake. > > I just added a slightly modified version of your fixes and uploaded > pyreadline 1.4.1 here: > > http://ipython.scipy.org/dist/ > > If others can confirms this works fine, we may be finally in the clear. > > Many thanks for your help, and again my apologies to users (and > Jorgen!) for making such a mess on win32. > > Regards, > > f > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkaufman at imago.com Wed Apr 11 13:40:31 2007 From: dkaufman at imago.com (Duane Kaufman) Date: Wed, 11 Apr 2007 12:40:31 -0500 Subject: [IPython-dev] Problems with physics profile Message-ID: <949BD319240E484B984463501CD7D17C010881F8@IMAGOEXCH1.corp.imago.com> Hi, I am trying to get the Physics profile working under Windows, but I get an error when starting (see below). I am running Ipython 0.8.0 and Scientific 2.6. Any hints as to what to look into? Thanks, Duane Error Follows: C:\Console2>C:\Python24\python.exe C:\Python24\scripts\ipython-script.py -pylab -p physics *** Simplified input for physical quantities enabled. ------------------------------------------------------------------------ --- exceptions.TypeError Traceback (most recent call last) C:\Console2\ c:\python24\lib\site-packages\ipython-0.8.0-py2.4.egg\IPython\Extensions \Physica lQInteractive.py 20 __license__ = Release.license 21 ---> 22 from Scientific.Physics.PhysicalQuantities import PhysicalQuantity 23 24 # This code can be set up to work with Numeric or with math for providin g the c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien tific\Ph ysics\PhysicalQuantities.py 591 592 _addUnit('Hz', '1/s') # Hertz --> 593 _addUnit('N', 'm*kg/s**2') # Newton 594 _addUnit('Pa', 'N/m**2') # Pascal 595 _addUnit('J', 'N*m') # Joule c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien tific\Ph ysics\PhysicalQuantities.py in _addUnit(name, unit) 573 raise KeyError('Unit ' + name + ' already defined') 574 if type(unit) == type(''): --> 575 unit = eval(unit, _unit_table) 576 for cruft in ['__builtins__', '__args__']: 577 try: del _unit_table[cruft] C:\Console2\ c:\python24\lib\site-packages\ScientificPython-2.6-py2.4-win32.egg\Scien tific\Ph ysics\PhysicalQuantities.py in __pow__(self, other) 367 raise TypeError("cannot exponentiate units with non-zero off set") 368 if type(other) == type(0): --> 369 return PhysicalUnit(other*self.names, pow(self.factor, other ), 370 map(lambda x,p=other: x*p, self.powers)) 371 if type(other) == type(0.): TypeError: unsupported operand type(s) for *: 'int' and 'NumberDict' WARNING: Loading of IPython.Extensions.PhysicalQInteractive failed. ------------------------------------------------------------------------ --- exceptions.NameError Traceback (most recent call last) C:\Console2\ NameError: name 'PhysicalQuantityInteractive' is not defined WARNING: Failure executing code: 'q = PhysicalQuantityInteractive' ------------------------------------------------------------------------ --- exceptions.NameError Traceback (most recent call last) C:\Console2\ NameError: name 'PhysicalQuantityInteractive' is not defined WARNING: Failure executing code: "g = PhysicalQuantityInteractive('9.8 m/s**2')" *** q is an alias for PhysicalQuantityInteractive *** g = 9.8 m/s^2 has been defined *** rad = pi/180 has been defined Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.8.0 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. IPython profile: physics Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. NOTICE: This e-mail communication may contain privileged or other confidential information for the sole use of the designated recipients. If you have received it in error, please advise the sender by reply email and immediately delete the message and any attachments without reviewing, copying or disclosing the contents. From fperez.net at gmail.com Wed Apr 11 13:47:15 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 11:47:15 -0600 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: On 4/11/07, aldarion wrote: > It looks the definition line of two function(clear_history of rlmain and > history) > miss a space(it should be four and now is three, and the function body lack > one space too) > and the function (clear_history) maybe responsible for the ' > exceptions.AttributeError', Ugh, sorry. I copy/pasted from the mail client and didn't notice it went in missing a space. 1.4.2 is up: http://ipython.scipy.org/dist/pyreadline-1.4.2.win32.exe http://ipython.scipy.org/dist/pyreadline-1.4.2.dev_r2238-py2.4.egg > there is still the IndexError error as Chris Calloway'said, no clue here Let me know if those help in any way, and see if you can send me a fuller traceback on that problem. I'm 100% blind here since I can't run any of this code at all... Thanks again for the help and patience! Cheers, f From erendisaldarion at gmail.com Wed Apr 11 13:51:40 2007 From: erendisaldarion at gmail.com (aldarion) Date: Thu, 12 Apr 2007 01:51:40 +0800 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: I have tested it already:) after fix the space problem(pyreadline1.4.2), ipython works and don't return the exceptions.AttributeError when run foo.py however, there is still the exceptions.IndexError when C:\>C:\Python25\python.exe C:\Python25\scripts\ipython "\Documents and Settings\cbcoasis\Desktop\test.py" On 4/12/07, Fernando Perez wrote: > > On 4/11/07, aldarion wrote: > > It looks the definition line of two function(clear_history of rlmain and > > history) > > miss a space(it should be four and now is three, and the function body > lack > > one space too) > > and the function (clear_history) maybe responsible for the ' > > exceptions.AttributeError', > > Ugh, sorry. I copy/pasted from the mail client and didn't notice it > went in missing a space. > > 1.4.2 is up: > > http://ipython.scipy.org/dist/pyreadline-1.4.2.win32.exe > http://ipython.scipy.org/dist/pyreadline-1.4.2.dev_r2238-py2.4.egg > > > there is still the IndexError error as Chris Calloway'said, no clue here > > Let me know if those help in any way, and see if you can send me a > fuller traceback on that problem. I'm 100% blind here since I can't > run any of this code at all... > > Thanks again for the help and patience! > > Cheers, > > f > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Wed Apr 11 13:53:57 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 11:53:57 -0600 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: On 4/11/07, aldarion wrote: > I have tested it already:) > after fix the space problem(pyreadline1.4.2), ipython works and don't return > the > exceptions.AttributeError when run foo.py > however, there is still the exceptions.IndexError when > C:\>C:\Python25\python.exe C:\Python25\scripts\ipython "\Documents and > Settings\cbcoasis\Desktop\test.py" Can you get a traceback from that? I'm trying to find out where the error could be coming from... thanks, f From erendisaldarion at gmail.com Wed Apr 11 14:00:43 2007 From: erendisaldarion at gmail.com (aldarion) Date: Thu, 12 Apr 2007 02:00:43 +0800 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: ok,here is the error, the foo.py is just something like "print 'test'"" [C:\Documents and Settings\Administrator\Desktop\note]c:\Python25\python.exe c:\ Python25\scripts\ipython foo.py --------------------------------------------------------------------------- Traceback (most recent call last) : tuple index out of range WARNING: Failure executing file: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.8.0 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: On 4/12/07, Fernando Perez wrote: > > On 4/11/07, aldarion wrote: > > I have tested it already:) > > after fix the space problem(pyreadline1.4.2), ipython works and don't > return > > the > > exceptions.AttributeError when run foo.py > > however, there is still the exceptions.IndexError when > > C:\>C:\Python25\python.exe C:\Python25\scripts\ipython "\Documents and > > Settings\cbcoasis\Desktop\test.py" > > Can you get a traceback from that? I'm trying to find out where the > error could be coming from... > > thanks, > > f > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Wed Apr 11 14:14:17 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 11 Apr 2007 12:14:17 -0600 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: On 4/11/07, aldarion wrote: > ok,here is the error, the foo.py is just something like "print 'test'"" > [C:\Documents and > Settings\Administrator\Desktop\note]c:\Python25\python.exe > c:\ > Python25\scripts\ipython foo.py > --------------------------------------------------------------------------- > Traceback (most recent call last) > > > : tuple index out of range > WARNING: Failure executing file: Darn. Unfortunately that traceback doesn't tell me much. I'm afraid this will stay at this point: I have a number of things to take care of and will be mostly offline until next Wednesday or so. If anyone comes up with a patch for this, great. If it's small I might be able to sneak in and commit it, but that's about it. Obviously if Jorgen is back, I'm sure he'll be able to clean things up on win32. Again, thanks to users for the help. Cheers, f From cbc at unc.edu Wed Apr 11 14:25:28 2007 From: cbc at unc.edu (Chris Calloway) Date: Wed, 11 Apr 2007 14:25:28 -0400 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: <461D2818.8050205@unc.edu> aldarion wrote: > ok,here is the error, the foo.py is just something like "print 'test'"" > [C:\Documents and > Settings\Administrator\Desktop\note]c:\Python25\python.exe c:\ > Python25\scripts\ipython foo.py > --------------------------------------------------------------------------- > Traceback (most recent call last) > > > : tuple index out of range > WARNING: Failure executing file: > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] > Type "copyright", "credits" or "license" for more information. > > IPython 0.8.0 -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: Correct. That's it, as I showed in my first reply. No pointer to a line number in what module or anything. Using the -pdb option on the command line doesn't put you into pdb in this case. The _ipython configuration file is also not getting generated. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 From rocky at panix.com Wed Apr 11 14:29:31 2007 From: rocky at panix.com (R. Bernstein) Date: Wed, 11 Apr 2007 14:29:31 -0400 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: <461D2818.8050205@unc.edu> References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> <461D2818.8050205@unc.edu> Message-ID: <17949.10507.935337.608586@panix3.panix.com> For what it's worth, if you are willing to wait a bit I've been able to debug ipython under pydb, and pydb installs exception handling. Chris Calloway writes: > aldarion wrote: > > ok,here is the error, the foo.py is just something like "print 'test'"" > > [C:\Documents and > > Settings\Administrator\Desktop\note]c:\Python25\python.exe c:\ > > Python25\scripts\ipython foo.py > > --------------------------------------------------------------------------- > > Traceback (most recent call last) > > > > > > : tuple index out of range > > WARNING: Failure executing file: > > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] > > Type "copyright", "credits" or "license" for more information. > > > > IPython 0.8.0 -- An enhanced Interactive Python. > > ? -> Introduction to IPython's features. > > %magic -> Information about IPython's 'magic' % functions. > > help -> Python's own help system. > > object? -> Details about 'object'. ?object also works, ?? prints more. > > > > In [1]: > > Correct. That's it, as I showed in my first reply. No pointer to a line > number in what module or anything. Using the -pdb option on the command > line doesn't put you into pdb in this case. The _ipython configuration > file is also not getting generated. > > -- > Sincerely, > > Chris Calloway > http://www.seacoos.org > office: 332 Chapman Hall phone: (919) 962-4323 > mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > From peter.skomoroch at gmail.com Thu Apr 12 19:54:15 2007 From: peter.skomoroch at gmail.com (Peter Skomoroch) Date: Thu, 12 Apr 2007 19:54:15 -0400 Subject: [IPython-dev] Amazon EC2 and ipython Message-ID: I recently posted a tutorial and public Fedora image with MPI, PyMPI, and numpy/scipy for cluster computing on Amazon EC2: http://www.datawrangling.com/mpi-cluster-with-python-and-amazon-ec2-part-2-of-3.html http://developer.amazonwebservices.com/connect/entry.jspa?externalID=705&categoryID=101 Has anyone tried running a parallel session with ipython on EC2? Any interest in me bundling ipython with the Amazon image? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivainio at gmail.com Sun Apr 15 16:05:28 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 16 Apr 2007 01:35:28 +0530 Subject: [IPython-dev] [IPython-user] Windows users: do NOT upgrade to 0.8.0 yet! In-Reply-To: References: Message-ID: <46cb515a0704151305j61a8762ek625bcd56f79803ae@mail.gmail.com> Hi Fernando & all, > I'm very sorry for the confusion and the time wasted for all. My > Windows install lives on a computer that died (hardware) this weekend > so I couldn't do any testing, and our win32 developers who regularly > work on the platform (Jorgen and Ville) have both been traveling, so I > completely dropped the ball for that OS. My apology. Related to this - things are finally improving on this front, and I can resume fiddling w/ IPython properly, to give you some slack again. :-) Great show of flexibility, BTW. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From list-ener at strank.info Mon Apr 16 02:31:27 2007 From: list-ener at strank.info (Stefan Rank) Date: Mon, 16 Apr 2007 08:31:27 +0200 Subject: [IPython-dev] ipython embedded in twisted, no threads Message-ID: <4623183F.4070807@strank.info> Hi, [apologies if this arrives twice, posting via gmane didn't work - yet.] attached is an ugly first attempt at embedding IPython in a twisted application without using threads. twisted.internet.stdio and a LineReceiver implementation are responsible for getting input events. I had to subclass the IPython shell and rearrange code to create a non-blocking callback interface (splitting on the main, blocking, raw_input call). It's far from perfect: readline functionality is missing (no commandline navigation, history navigation, completion), and sometimes continuation lines eat the input counter (In[2] ... In[4]). Would IPython developers be interested in patches that allow a less ugly version of such a callback-friendly subclass? ;-) The basic idea: refactor the main loop (InteractiveShell.interact) to:: setup() while ...: promptforline() raw_input handleline() teardown() (I think it might also be interesting for the frontend to the IPython parallel computing effort, which uses twisted.) cheers, stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: twistedipython.py Type: text/x-python Size: 13037 bytes Desc: not available URL: From vivainio at gmail.com Mon Apr 16 12:18:29 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 16 Apr 2007 21:48:29 +0530 Subject: [IPython-dev] Ipython crash w/o readline Message-ID: <46cb515a0704160918r228ee86s363d5ec34e905a76@mail.gmail.com> IPython used to crash when readline was not installed. Fixed in current svn. Also, I have a fix for recursive exception handling (bugs in exception hanging print the exceptions infinitely), here's the diff but I hesitate a little bit, not that it breaks stuff but the exceptions system is a bit messy & I'd rather wrap the whole except hook in one big try-except and wondered why it hasn't been done already. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From jorgen.stenarson at bostream.nu Mon Apr 16 14:16:07 2007 From: jorgen.stenarson at bostream.nu (=?UTF-8?B?SsO2cmdlbiBTdGVuYXJzb24=?=) Date: Mon, 16 Apr 2007 20:16:07 +0200 Subject: [IPython-dev] ipython embedded in twisted, no threads In-Reply-To: <4623183F.4070807@strank.info> References: <4623183F.4070807@strank.info> Message-ID: <4623BD67.4010007@bostream.nu> Hi Stefan, I'm not sure exactly what you are after (I don't use twisted myself). But in pyreadline it is now fairly straightforward to add a new console class (there are currently two: the standard win32 and one for .NET/IronPython) which should implement the lowlevel keyboard and screen output routines. If this is what is needed I would be happy to accept patches and answer questions to help make it happen. We would probably also have to work out a more sofisticated method of choosing low-level console backend than what is used now. /J?rgen Stefan Rank skrev: > Hi, > [apologies if this arrives twice, posting via gmane didn't work - yet.] > > attached is an ugly first attempt at embedding IPython in a twisted > application without using threads. > > twisted.internet.stdio and a LineReceiver implementation are responsible > for getting input events. > I had to subclass the IPython shell and rearrange code to > create a non-blocking callback interface (splitting on the main, > blocking, raw_input call). > > It's far from perfect: readline functionality is missing (no commandline > navigation, history navigation, completion), and sometimes continuation > lines eat the input counter (In[2] ... In[4]). > > Would IPython developers be interested in patches that allow a less ugly > version of such a callback-friendly subclass? ;-) > The basic idea: refactor the main loop (InteractiveShell.interact) to:: > > setup() > while ...: > promptforline() > raw_input > handleline() > teardown() > > (I think it might also be interesting for the frontend to the IPython > parallel computing effort, which uses twisted.) > > cheers, > stefan > > > ------------------------------------------------------------------------ > > '''Testing a way to embed IPython in a twisted app without using threads. > (seems to work on Py25/WinXP, twisted2.5 patched with #2157, IPython0.8.0) > > twisted.internet.stdio is responsible for getting user input. > An implementation of the LineReceiver protocol passes received lines > to a custom subclass of the IPython shell (main raw_input call removed). > > No readline behaviour is available. > (But IPython still sets up readline and uses it for colour printing.) > > TODO: > integrate readline functionality: two possibilities > > 1) Change pyreadline so that it can be called back by t.i.stdio for > all things except waiting for input (i.e. completion, key bindings, ...) > This would mean no further changes to IPython, which would still > be using pyreadline directly. > (or use a GNU readline callback interface: a t.i.stdio-alike would be > polling/selecting for input, but then call readline to actually consume it.) > 2) Build a readline compatible interface for t.i.stdio > (only the parts for setting up completeres, key bindings, ...) > and make the IPython subclass use that instead of pyreadline > > As there is a lot of pasted IPython code including comments, I added > ##### multi-hash comments and > docstrings explaining the rearrangements. > > :author: strank > ''' > > __docformat__ = "restructuredtext en" > > import sys > import __builtin__ > > from twisted.internet import reactor, stdio > from twisted.protocols import basic > from IPython.Shell import IPShellEmbed > from IPython.iplib import InteractiveShell, ultraTB > from IPython.ipmaker import make_IPython > > > def main(): > ###### this is what we want: > reactor.callWhenRunning(startTwistedStdioShell) > ###### because this blocks the reactor while IPython is active: > #reactor.callWhenRunning(startIPShell) > reactor.run() > > > def startIPShell(args=None): > '''The non-twisted-friendly way of embedding IPython.''' > if args is None: > args = [] > some_recognisable_local = 'WAGAWAGA' # gets exposed in Shell > ipshell = IPShellEmbed(args, > banner='Standard IPython called from twisted (blocking)', > exit_msg='Leaving Interpreter, back to program.') > ipshell('***Called from top level. ' > 'Hit Ctrl-D to exit interpreter and continue program.') > reactor.stop() > > > def startTwistedStdioShell(args=None, local_ns=None): > '''On Windows, this only works with a patched twisted, > because twisted.internet.stdio in twisted2.5 is unix only, > see ticket #2157. > ''' > if args is None: > args = [] > ipshell = TwistedIPShellEmbed([], > banner='IPython embedded in a Twisted application', > exit_msg='Leaving Interpreter, back to program.') > sp = ShellProtocol(ipshell, '***Called from top level. ', local_ns=local_ns) > #sp.setRawMode() > stdio.StandardIO(sp) > > > class TwistedIPShellEmbed(IPShellEmbed): > '''Same as superclass, BUT: > __init__ is duplicated, with a single difference: > The actual IP shell_class is set to our own subclass. > __call__ is split into two methods for setup / teardown. > ''' > > def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None, > user_ns=None): > """Note that argv here is a string, NOT a list.""" > self.set_banner(banner) > self.set_exit_msg(exit_msg) > self.set_dummy_mode(0) > # sys.displayhook is a global, we need to save the user's original > # Don't rely on __displayhook__, as the user may have changed that. > self.sys_displayhook_ori = sys.displayhook > # save readline completer status > try: > #print 'Save completer',sys.ipcompleter # dbg > self.sys_ipcompleter_ori = sys.ipcompleter > except: > pass # not nested with IPython > self.IP = make_IPython(argv,rc_override=rc_override, > embedded=True, > user_ns=user_ns, > ###### HERE IS THE DIFFERENCE -- StefanRank > shell_class=TwistedInteractiveShell) > # copy our own displayhook also > self.sys_displayhook_embed = sys.displayhook > # and leave the system's display hook clean > sys.displayhook = self.sys_displayhook_ori > # don't use the ipython crash handler so that user exceptions aren't > # trapped > sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors, > mode = self.IP.rc.xmode, > call_pdb = self.IP.rc.pdb) > self.restore_system_completer() > > def __call__(self,header='',local_ns=None,global_ns=None,dummy=None): > # Set global subsystems (display,completions) to our values > sys.displayhook = self.sys_displayhook_embed > if self.IP.has_readline: > self.IP.set_completer() > if self.banner and header: > format = '%s\n%s\n' > else: > format = '%s%s\n' > banner = format % (self.banner,header) > # Call the embedding code with a stack depth of 1 so it can skip over > # our call and get the original caller's namespaces. > ###### STOP HERE, THIS embed_mainloop DOESN'T BLOCK, RETURN THE SHELL --StefanRank > return self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1) > > def teardown(self): > ###### call the code that would have been called at the end of IP.embed_mainloop: > self.IP.teardown() > ###### This is the code formerly known as: the end of __call__: > if self.exit_msg: > print self.exit_msg > # Restore global systems (display, completion) > sys.displayhook = self.sys_displayhook_ori > self.restore_system_completer() > > > class TwistedInteractiveShell(InteractiveShell): > '''Subclassing to remove raw_input call and provide a callback interface. > Copy-pasted and split up code of embed_mainloop, interact, raw_input. > ''' > > def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): > # Get locals and globals from caller > if local_ns is None or global_ns is None: > call_frame = sys._getframe(stack_depth).f_back > if local_ns is None: > local_ns = call_frame.f_locals > if global_ns is None: > global_ns = call_frame.f_globals > self.user_global_ns = global_ns > local_varnames = local_ns.keys() > self.user_ns.update(local_ns) > if local_ns is None and global_ns is None: > self.user_global_ns.update(__main__.__dict__) > self.set_completer_frame() > self.add_builtins() > self.interact(header) > return self ###### needed for later calls, interact is now non-blocking > > def teardown(self): > '''This is the code formerly known as: the end of interact and embed_mainloop.''' > ##### from interact: > # We are off again... > __builtin__.__dict__['__IPYTHON__active'] -= 1 > ##### from embed_mainloop: > # now, purge out the user namespace from anything we might have added > # from the caller's local namespace > ###### local_varnames not accessible any more, > ###### should probably be saved... (TODO) > ###delvar = self.user_ns.pop > ###for var in local_varnames: > ### delvar(var,None) > # and clean builtins we may have overridden > self.clean_builtins() > > def interact(self, banner=None): > ###### HERE IT GETS HAIRY: code copied from self.interact(header) > if self.exit_now: > # batch run -> do not interact > return ###### This does not make any sense now, since we are non-blocking > cprt = 'Type "copyright", "credits" or "license" for more information.' > if banner is None: > self.write("Python %s on %s\n%s\n(%s)\n" % > (sys.version, sys.platform, cprt, > self.__class__.__name__)) > else: > self.write(banner) > more = 0 > # Mark activity in the builtins > __builtin__.__dict__['__IPYTHON__active'] += 1 > self.promptForLine(more) > return self > > def promptForLine(self, more): > '''New method. To be called before waiting for the next line.''' > prompt = '' > ###### THIS NEEDED TO BE UNTANGLED: originally a while loop in self.interact > # exit_now is set by a call to %Exit or %Quit > if not self.exit_now: > if more: > prompt = self.hooks.generate_prompt(True) > if self.autoindent: > self.readline_startup_hook(self.pre_readline) > else: > prompt = self.hooks.generate_prompt(False) > ####### code from self.raw_input: > self.set_completer() > ####### write the prompt here, writing it in the LineReceiver > ####### with sendLine messes up the colouring > self.write(prompt) > ####### raw_input BEGONE!!! > ####### unfortunately all the exception handling in self.interact is also gone. > ####### return and wait for a call to useLine > > def useLine(self, line, continue_prompt=False): > '''New method. To be called with a new received line.''' > ####### code from self.raw_input: > if line.strip(): > if continue_prompt: > self.input_hist_raw[-1] += '%s\n' % line > if self.has_readline: # and some config option is set? > try: > histlen = self.readline.get_current_history_length() > newhist = self.input_hist_raw[-1].rstrip() > self.readline.remove_history_item(histlen-1) > self.readline.replace_history_item(histlen-2,newhist) > except AttributeError: > pass # re{move,place}_history_item are new in 2.4. > else: > self.input_hist_raw.append('%s\n' % line) > try: > lineout = self.prefilter(line,continue_prompt) > except: > # blanket except, in case a user-defined prefilter crashes, so it > # can't take all of ipython with it. > self.showtraceback() > lineout = '' > ###### CODE FROM INTERACT AGAIN: > more = self.push(lineout) > if (self.SyntaxTB.last_syntax_error and > self.rc.autoedit_syntax): > self.edit_syntax_error() > self.promptForLine(more) > ###### indicate if we want to quit > return not self.exit_now > > > class ShellProtocol(basic.LineReceiver): > delimiter = '\n' # does not work with '\r\n' on Windows... > # this might be an issue with the #2157 patches? > > def __init__(self, ipshell, banner, **kwargs): > self.ipshell = ipshell > self.banner = banner > self.kwargs = kwargs > > def connectionMade(self): > #self.sendLine("Yay, type something!") > # locals here are available in the shell: > # (but in practice the locals of the ShellProtocol() call site > # would be more interesting.) > another_strange_local = 'hubabuba' > from twisted.internet import reactor > self.sheller = self.ipshell(self.banner > + '\n quit.....quits via LineReceiver,' > + '\n exit()...quits via IPython,' > + '\n pause....test pausing the LineReceiver', > **self.kwargs) > > def lineReceived(self, line): > if line == 'quit': > self.sendLine('OK quitting') > self.transport.loseConnection() > return > if line == 'pause': > self.sendLine('OK pausing for 2 seconds') > self.pauseProducing() > self.clearLineBuffer() > # still receives keys typed during the pause, > # no matter how many clearLineBuffer()s, I use. > # might be a feature of Windows cmd... ? > def restart(): > self.clearLineBuffer() > self.resumeProducing() > self.clearLineBuffer() > reactor.callLater(2, restart) > return > #self.sendLine("Echo: " + line) > if not self.sheller.useLine(line): # processes line, prints output and next prompt > self.sendLine("IPython wants to quit") > self.transport.loseConnection() > #self.transport.write("Yay, type more!") > > #def rawDataReceived(self, data): > # self.sendLine('RawEcho: ' + str(data)) > # self.transport.write("Yay, type more!") > > def connectionLost(self, reason): > try: > self.ipshell.teardown() > except IOError: > pass # is raised by IPython code when you type quit > # stop the reactor, only because this is meant to be run in Stdio. > reactor.stop() > > > if __name__ == '__main__': > main() > > > ------------------------------------------------------------------------ > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev From vivainio at gmail.com Mon Apr 16 14:50:22 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Tue, 17 Apr 2007 00:20:22 +0530 Subject: [IPython-dev] Ipython crash w/o readline In-Reply-To: <46cb515a0704160918r228ee86s363d5ec34e905a76@mail.gmail.com> References: <46cb515a0704160918r228ee86s363d5ec34e905a76@mail.gmail.com> Message-ID: <46cb515a0704161150n521e084q75df396f6decec40@mail.gmail.com> On 4/16/07, Ville M. Vainio wrote: > Also, I have a fix for recursive exception handling (bugs in exception > hanging print the exceptions infinitely), here's the diff but I > hesitate a little bit, not that it breaks stuff but the exceptions > system is a bit messy & I'd rather wrap the whole except hook in one > big try-except and wondered why it hasn't been done already. Anu yes, as I was so kindly pointed out, I forgot the attachment. Also, I reverted the version because it didn't work properly, so now it's nowhere to be found. :) What I had is an attribute that informs IPython that it is inside exception handler and aborts (os.abort) IPython if it's entered again, before resetting the flag. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From jorgen.stenarson at bostream.nu Mon Apr 16 15:21:27 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Mon, 16 Apr 2007 21:21:27 +0200 Subject: [IPython-dev] Win32 - call for pyreadline testing In-Reply-To: References: <461CFDE6.30204@gmail.com> <461D04F6.3000109@unc.edu> <461D0D75.80507@gmail.com> Message-ID: <4623CCB7.3030609@bostream.nu> Hi, I think I have isolated the problem. The attached patch duplicates some code from higher up in the function to create the global and local name spaces. I don't know enough about this function to be sure if the patch is correct but it removed the problem reported for me. /J?rgen Fernando Perez skrev: > On 4/11/07, aldarion wrote: >> ok,here is the error, the foo.py is just something like "print 'test'"" >> [C:\Documents and >> Settings\Administrator\Desktop\note]c:\Python25\python.exe >> c:\ >> Python25\scripts\ipython foo.py >> --------------------------------------------------------------------------- >> Traceback (most recent call last) >> >> >> : tuple index out of range >> WARNING: Failure executing file: > > Darn. Unfortunately that traceback doesn't tell me much. > > I'm afraid this will stay at this point: I have a number of things to > take care of and will be mostly offline until next Wednesday or so. > > If anyone comes up with a patch for this, great. If it's small I > might be able to sneak in and commit it, but that's about it. > > Obviously if Jorgen is back, I'm sure he'll be able to clean things up on win32. > > Again, thanks to users for the help. > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/applefile Size: 1483 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: iplib.patch Type: application/octet-stream Size: 880 bytes Desc: not available URL: From list-ener at strank.info Mon Apr 16 18:23:16 2007 From: list-ener at strank.info (Stefan Rank) Date: Tue, 17 Apr 2007 00:23:16 +0200 Subject: [IPython-dev] ipython embedded in twisted, no threads In-Reply-To: <4623BD67.4010007@bostream.nu> References: <4623183F.4070807@strank.info> <4623BD67.4010007@bostream.nu> Message-ID: <4623F754.9060706@strank.info> Hi J?rgen, on 16.04.2007 20:16 J?rgen Stenarson said the following: > Hi Stefan, > > I'm not sure exactly what you are after (I don't use twisted myself). I am not an expert either, I am afraid. > But in pyreadline it is now fairly straightforward to add a new console > class (there are currently two: the standard win32 and one for > .NET/IronPython) which should implement the lowlevel keyboard and screen > output routines. If this is what is needed I would be happy to accept > patches and answer questions to help make it happen. We would probably > also have to work out a more sofisticated method of choosing low-level > console backend than what is used now. I think what is needed for readline support in twisted is not a new backend but an additional frontend/API. The 'problem' (read advantage ;-) with twisted is that it needs a callback interface that does not block, as it wants to do the polling for input events itself. GNU readline has a callback interface that should be usable for that: http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC41 (for triggering single character reading) Would this be possible with pyreadline? cheers, stefan > Stefan Rank skrev: >> Hi, >> [apologies if this arrives twice, posting via gmane didn't work - yet.] >> >> attached is an ugly first attempt at embedding IPython in a twisted >> application without using threads. >> >> twisted.internet.stdio and a LineReceiver implementation are responsible >> for getting input events. >> I had to subclass the IPython shell and rearrange code to >> create a non-blocking callback interface (splitting on the main, >> blocking, raw_input call). >> >> It's far from perfect: readline functionality is missing (no commandline >> navigation, history navigation, completion), and sometimes continuation >> lines eat the input counter (In[2] ... In[4]). >> >> Would IPython developers be interested in patches that allow a less ugly >> version of such a callback-friendly subclass? ;-) >> The basic idea: refactor the main loop (InteractiveShell.interact) to:: >> >> setup() >> while ...: >> promptforline() >> raw_input >> handleline() >> teardown() >> >> (I think it might also be interesting for the frontend to the IPython >> parallel computing effort, which uses twisted.) >> >> cheers, >> stefan >> >> >> ------------------------------------------------------------------------ >> >> '''Testing a way to embed IPython in a twisted app without using threads. >> (seems to work on Py25/WinXP, twisted2.5 patched with #2157, IPython0.8.0) >> >> twisted.internet.stdio is responsible for getting user input. >> An implementation of the LineReceiver protocol passes received lines >> to a custom subclass of the IPython shell (main raw_input call removed). >> >> No readline behaviour is available. >> (But IPython still sets up readline and uses it for colour printing.) >> >> TODO: >> integrate readline functionality: two possibilities >> >> 1) Change pyreadline so that it can be called back by t.i.stdio for >> all things except waiting for input (i.e. completion, key bindings, ...) >> This would mean no further changes to IPython, which would still >> be using pyreadline directly. >> (or use a GNU readline callback interface: a t.i.stdio-alike would be >> polling/selecting for input, but then call readline to actually consume it.) >> 2) Build a readline compatible interface for t.i.stdio >> (only the parts for setting up completeres, key bindings, ...) >> and make the IPython subclass use that instead of pyreadline >> >> As there is a lot of pasted IPython code including comments, I added >> ##### multi-hash comments and >> docstrings explaining the rearrangements. >> >> :author: strank >> ''' >> >> __docformat__ = "restructuredtext en" >> >> import sys >> import __builtin__ >> >> from twisted.internet import reactor, stdio >> from twisted.protocols import basic >> from IPython.Shell import IPShellEmbed >> from IPython.iplib import InteractiveShell, ultraTB >> from IPython.ipmaker import make_IPython >> >> >> def main(): >> ###### this is what we want: >> reactor.callWhenRunning(startTwistedStdioShell) >> ###### because this blocks the reactor while IPython is active: >> #reactor.callWhenRunning(startIPShell) >> reactor.run() >> >> >> def startIPShell(args=None): >> '''The non-twisted-friendly way of embedding IPython.''' >> if args is None: >> args = [] >> some_recognisable_local = 'WAGAWAGA' # gets exposed in Shell >> ipshell = IPShellEmbed(args, >> banner='Standard IPython called from twisted (blocking)', >> exit_msg='Leaving Interpreter, back to program.') >> ipshell('***Called from top level. ' >> 'Hit Ctrl-D to exit interpreter and continue program.') >> reactor.stop() >> >> >> def startTwistedStdioShell(args=None, local_ns=None): >> '''On Windows, this only works with a patched twisted, >> because twisted.internet.stdio in twisted2.5 is unix only, >> see ticket #2157. >> ''' >> if args is None: >> args = [] >> ipshell = TwistedIPShellEmbed([], >> banner='IPython embedded in a Twisted application', >> exit_msg='Leaving Interpreter, back to program.') >> sp = ShellProtocol(ipshell, '***Called from top level. ', local_ns=local_ns) >> #sp.setRawMode() >> stdio.StandardIO(sp) >> >> >> class TwistedIPShellEmbed(IPShellEmbed): >> '''Same as superclass, BUT: >> __init__ is duplicated, with a single difference: >> The actual IP shell_class is set to our own subclass. >> __call__ is split into two methods for setup / teardown. >> ''' >> >> def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None, >> user_ns=None): >> """Note that argv here is a string, NOT a list.""" >> self.set_banner(banner) >> self.set_exit_msg(exit_msg) >> self.set_dummy_mode(0) >> # sys.displayhook is a global, we need to save the user's original >> # Don't rely on __displayhook__, as the user may have changed that. >> self.sys_displayhook_ori = sys.displayhook >> # save readline completer status >> try: >> #print 'Save completer',sys.ipcompleter # dbg >> self.sys_ipcompleter_ori = sys.ipcompleter >> except: >> pass # not nested with IPython >> self.IP = make_IPython(argv,rc_override=rc_override, >> embedded=True, >> user_ns=user_ns, >> ###### HERE IS THE DIFFERENCE -- StefanRank >> shell_class=TwistedInteractiveShell) >> # copy our own displayhook also >> self.sys_displayhook_embed = sys.displayhook >> # and leave the system's display hook clean >> sys.displayhook = self.sys_displayhook_ori >> # don't use the ipython crash handler so that user exceptions aren't >> # trapped >> sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors, >> mode = self.IP.rc.xmode, >> call_pdb = self.IP.rc.pdb) >> self.restore_system_completer() >> >> def __call__(self,header='',local_ns=None,global_ns=None,dummy=None): >> # Set global subsystems (display,completions) to our values >> sys.displayhook = self.sys_displayhook_embed >> if self.IP.has_readline: >> self.IP.set_completer() >> if self.banner and header: >> format = '%s\n%s\n' >> else: >> format = '%s%s\n' >> banner = format % (self.banner,header) >> # Call the embedding code with a stack depth of 1 so it can skip over >> # our call and get the original caller's namespaces. >> ###### STOP HERE, THIS embed_mainloop DOESN'T BLOCK, RETURN THE SHELL --StefanRank >> return self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1) >> >> def teardown(self): >> ###### call the code that would have been called at the end of IP.embed_mainloop: >> self.IP.teardown() >> ###### This is the code formerly known as: the end of __call__: >> if self.exit_msg: >> print self.exit_msg >> # Restore global systems (display, completion) >> sys.displayhook = self.sys_displayhook_ori >> self.restore_system_completer() >> >> >> class TwistedInteractiveShell(InteractiveShell): >> '''Subclassing to remove raw_input call and provide a callback interface. >> Copy-pasted and split up code of embed_mainloop, interact, raw_input. >> ''' >> >> def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): >> # Get locals and globals from caller >> if local_ns is None or global_ns is None: >> call_frame = sys._getframe(stack_depth).f_back >> if local_ns is None: >> local_ns = call_frame.f_locals >> if global_ns is None: >> global_ns = call_frame.f_globals >> self.user_global_ns = global_ns >> local_varnames = local_ns.keys() >> self.user_ns.update(local_ns) >> if local_ns is None and global_ns is None: >> self.user_global_ns.update(__main__.__dict__) >> self.set_completer_frame() >> self.add_builtins() >> self.interact(header) >> return self ###### needed for later calls, interact is now non-blocking >> >> def teardown(self): >> '''This is the code formerly known as: the end of interact and embed_mainloop.''' >> ##### from interact: >> # We are off again... >> __builtin__.__dict__['__IPYTHON__active'] -= 1 >> ##### from embed_mainloop: >> # now, purge out the user namespace from anything we might have added >> # from the caller's local namespace >> ###### local_varnames not accessible any more, >> ###### should probably be saved... (TODO) >> ###delvar = self.user_ns.pop >> ###for var in local_varnames: >> ### delvar(var,None) >> # and clean builtins we may have overridden >> self.clean_builtins() >> >> def interact(self, banner=None): >> ###### HERE IT GETS HAIRY: code copied from self.interact(header) >> if self.exit_now: >> # batch run -> do not interact >> return ###### This does not make any sense now, since we are non-blocking >> cprt = 'Type "copyright", "credits" or "license" for more information.' >> if banner is None: >> self.write("Python %s on %s\n%s\n(%s)\n" % >> (sys.version, sys.platform, cprt, >> self.__class__.__name__)) >> else: >> self.write(banner) >> more = 0 >> # Mark activity in the builtins >> __builtin__.__dict__['__IPYTHON__active'] += 1 >> self.promptForLine(more) >> return self >> >> def promptForLine(self, more): >> '''New method. To be called before waiting for the next line.''' >> prompt = '' >> ###### THIS NEEDED TO BE UNTANGLED: originally a while loop in self.interact >> # exit_now is set by a call to %Exit or %Quit >> if not self.exit_now: >> if more: >> prompt = self.hooks.generate_prompt(True) >> if self.autoindent: >> self.readline_startup_hook(self.pre_readline) >> else: >> prompt = self.hooks.generate_prompt(False) >> ####### code from self.raw_input: >> self.set_completer() >> ####### write the prompt here, writing it in the LineReceiver >> ####### with sendLine messes up the colouring >> self.write(prompt) >> ####### raw_input BEGONE!!! >> ####### unfortunately all the exception handling in self.interact is also gone. >> ####### return and wait for a call to useLine >> >> def useLine(self, line, continue_prompt=False): >> '''New method. To be called with a new received line.''' >> ####### code from self.raw_input: >> if line.strip(): >> if continue_prompt: >> self.input_hist_raw[-1] += '%s\n' % line >> if self.has_readline: # and some config option is set? >> try: >> histlen = self.readline.get_current_history_length() >> newhist = self.input_hist_raw[-1].rstrip() >> self.readline.remove_history_item(histlen-1) >> self.readline.replace_history_item(histlen-2,newhist) >> except AttributeError: >> pass # re{move,place}_history_item are new in 2.4. >> else: >> self.input_hist_raw.append('%s\n' % line) >> try: >> lineout = self.prefilter(line,continue_prompt) >> except: >> # blanket except, in case a user-defined prefilter crashes, so it >> # can't take all of ipython with it. >> self.showtraceback() >> lineout = '' >> ###### CODE FROM INTERACT AGAIN: >> more = self.push(lineout) >> if (self.SyntaxTB.last_syntax_error and >> self.rc.autoedit_syntax): >> self.edit_syntax_error() >> self.promptForLine(more) >> ###### indicate if we want to quit >> return not self.exit_now >> >> >> class ShellProtocol(basic.LineReceiver): >> delimiter = '\n' # does not work with '\r\n' on Windows... >> # this might be an issue with the #2157 patches? >> >> def __init__(self, ipshell, banner, **kwargs): >> self.ipshell = ipshell >> self.banner = banner >> self.kwargs = kwargs >> >> def connectionMade(self): >> #self.sendLine("Yay, type something!") >> # locals here are available in the shell: >> # (but in practice the locals of the ShellProtocol() call site >> # would be more interesting.) >> another_strange_local = 'hubabuba' >> from twisted.internet import reactor >> self.sheller = self.ipshell(self.banner >> + '\n quit.....quits via LineReceiver,' >> + '\n exit()...quits via IPython,' >> + '\n pause....test pausing the LineReceiver', >> **self.kwargs) >> >> def lineReceived(self, line): >> if line == 'quit': >> self.sendLine('OK quitting') >> self.transport.loseConnection() >> return >> if line == 'pause': >> self.sendLine('OK pausing for 2 seconds') >> self.pauseProducing() >> self.clearLineBuffer() >> # still receives keys typed during the pause, >> # no matter how many clearLineBuffer()s, I use. >> # might be a feature of Windows cmd... ? >> def restart(): >> self.clearLineBuffer() >> self.resumeProducing() >> self.clearLineBuffer() >> reactor.callLater(2, restart) >> return >> #self.sendLine("Echo: " + line) >> if not self.sheller.useLine(line): # processes line, prints output and next prompt >> self.sendLine("IPython wants to quit") >> self.transport.loseConnection() >> #self.transport.write("Yay, type more!") >> >> #def rawDataReceived(self, data): >> # self.sendLine('RawEcho: ' + str(data)) >> # self.transport.write("Yay, type more!") >> >> def connectionLost(self, reason): >> try: >> self.ipshell.teardown() >> except IOError: >> pass # is raised by IPython code when you type quit >> # stop the reactor, only because this is meant to be run in Stdio. >> reactor.stop() >> >> >> if __name__ == '__main__': >> main() >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev From ellisonbg.net at gmail.com Wed Apr 18 13:46:14 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Wed, 18 Apr 2007 11:46:14 -0600 Subject: [IPython-dev] Amazon EC2 and ipython In-Reply-To: References: Message-ID: <6ce0ac130704181046g538da284oaca942563b145a47@mail.gmail.com> Peter, While I have an EC2 account, I have not gotten around to trying ipython1 out on it. I would love to see this happen and can help in any way. But...we are about to release a new version of ipython1 and I would wait until we have done that. You can watch this list for the announcement soon. Also, two more things: 1. What MPI implementation are you using? 2. Have you tried mpi4py? At this point it blows all the other python mpi bindings out of the water. I highly recommend it. 3. Can you make the image publicly available? Let's keep in touch about this. Cheers, Brian On 4/12/07, Peter Skomoroch wrote: > I recently posted a tutorial and public Fedora image with MPI, PyMPI, and > numpy/scipy for cluster computing on Amazon EC2: > > http://www.datawrangling.com/mpi-cluster-with-python-and-amazon-ec2-part-2-of-3.html > > http://developer.amazonwebservices.com/connect/entry.jspa?externalID=705&categoryID=101 > > Has anyone tried running a parallel session with ipython on EC2? Any > interest in me bundling ipython with the Amazon image? > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > From ellisonbg.net at gmail.com Wed Apr 18 13:48:42 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Wed, 18 Apr 2007 11:48:42 -0600 Subject: [IPython-dev] ipython embedded in twisted, no threads In-Reply-To: <4623F754.9060706@strank.info> References: <4623183F.4070807@strank.info> <4623BD67.4010007@bostream.nu> <4623F754.9060706@strank.info> Message-ID: <6ce0ac130704181048j4d2a1e2br16480566ac238d52@mail.gmail.com> I am interested in this, but unfortunately am very busy right now. Another thing to keep in mind. In a future version of IPython, IPython _will be_ running in a twisted process, so this type of intgration will be built in. But, doing that will require a full refactoring of IPython - which we are in the process of doing. Keep us posted on how this goes? Brian On 4/16/07, Stefan Rank wrote: > Hi J?rgen, > > on 16.04.2007 20:16 J?rgen Stenarson said the following: > > Hi Stefan, > > > > I'm not sure exactly what you are after (I don't use twisted myself). > > I am not an expert either, I am afraid. > > > But in pyreadline it is now fairly straightforward to add a new console > > class (there are currently two: the standard win32 and one for > > .NET/IronPython) which should implement the lowlevel keyboard and screen > > output routines. If this is what is needed I would be happy to accept > > patches and answer questions to help make it happen. We would probably > > also have to work out a more sofisticated method of choosing low-level > > console backend than what is used now. > > I think what is needed for readline support in twisted is not a new > backend but an additional frontend/API. > The 'problem' (read advantage ;-) with twisted is that it needs a > callback interface that does not block, as it wants to do the polling > for input events itself. > > GNU readline has a callback interface that should be usable for that: > http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC41 > (for triggering single character reading) > Would this be possible with pyreadline? > > cheers, > stefan > > > Stefan Rank skrev: > >> Hi, > >> [apologies if this arrives twice, posting via gmane didn't work - yet.] > >> > >> attached is an ugly first attempt at embedding IPython in a twisted > >> application without using threads. > >> > >> twisted.internet.stdio and a LineReceiver implementation are responsible > >> for getting input events. > >> I had to subclass the IPython shell and rearrange code to > >> create a non-blocking callback interface (splitting on the main, > >> blocking, raw_input call). > >> > >> It's far from perfect: readline functionality is missing (no commandline > >> navigation, history navigation, completion), and sometimes continuation > >> lines eat the input counter (In[2] ... In[4]). > >> > >> Would IPython developers be interested in patches that allow a less ugly > >> version of such a callback-friendly subclass? ;-) > >> The basic idea: refactor the main loop (InteractiveShell.interact) to:: > >> > >> setup() > >> while ...: > >> promptforline() > >> raw_input > >> handleline() > >> teardown() > >> > >> (I think it might also be interesting for the frontend to the IPython > >> parallel computing effort, which uses twisted.) > >> > >> cheers, > >> stefan > >> > >> > >> ------------------------------------------------------------------------ > >> > >> '''Testing a way to embed IPython in a twisted app without using threads. > >> (seems to work on Py25/WinXP, twisted2.5 patched with #2157, IPython0.8.0) > >> > >> twisted.internet.stdio is responsible for getting user input. > >> An implementation of the LineReceiver protocol passes received lines > >> to a custom subclass of the IPython shell (main raw_input call removed). > >> > >> No readline behaviour is available. > >> (But IPython still sets up readline and uses it for colour printing.) > >> > >> TODO: > >> integrate readline functionality: two possibilities > >> > >> 1) Change pyreadline so that it can be called back by t.i.stdio for > >> all things except waiting for input (i.e. completion, key bindings, ...) > >> This would mean no further changes to IPython, which would still > >> be using pyreadline directly. > >> (or use a GNU readline callback interface: a t.i.stdio-alike would be > >> polling/selecting for input, but then call readline to actually consume it.) > >> 2) Build a readline compatible interface for t.i.stdio > >> (only the parts for setting up completeres, key bindings, ...) > >> and make the IPython subclass use that instead of pyreadline > >> > >> As there is a lot of pasted IPython code including comments, I added > >> ##### multi-hash comments and > >> docstrings explaining the rearrangements. > >> > >> :author: strank > >> ''' > >> > >> __docformat__ = "restructuredtext en" > >> > >> import sys > >> import __builtin__ > >> > >> from twisted.internet import reactor, stdio > >> from twisted.protocols import basic > >> from IPython.Shell import IPShellEmbed > >> from IPython.iplib import InteractiveShell, ultraTB > >> from IPython.ipmaker import make_IPython > >> > >> > >> def main(): > >> ###### this is what we want: > >> reactor.callWhenRunning(startTwistedStdioShell) > >> ###### because this blocks the reactor while IPython is active: > >> #reactor.callWhenRunning(startIPShell) > >> reactor.run() > >> > >> > >> def startIPShell(args=None): > >> '''The non-twisted-friendly way of embedding IPython.''' > >> if args is None: > >> args = [] > >> some_recognisable_local = 'WAGAWAGA' # gets exposed in Shell > >> ipshell = IPShellEmbed(args, > >> banner='Standard IPython called from twisted (blocking)', > >> exit_msg='Leaving Interpreter, back to program.') > >> ipshell('***Called from top level. ' > >> 'Hit Ctrl-D to exit interpreter and continue program.') > >> reactor.stop() > >> > >> > >> def startTwistedStdioShell(args=None, local_ns=None): > >> '''On Windows, this only works with a patched twisted, > >> because twisted.internet.stdio in twisted2.5 is unix only, > >> see ticket #2157. > >> ''' > >> if args is None: > >> args = [] > >> ipshell = TwistedIPShellEmbed([], > >> banner='IPython embedded in a Twisted application', > >> exit_msg='Leaving Interpreter, back to program.') > >> sp = ShellProtocol(ipshell, '***Called from top level. ', local_ns=local_ns) > >> #sp.setRawMode() > >> stdio.StandardIO(sp) > >> > >> > >> class TwistedIPShellEmbed(IPShellEmbed): > >> '''Same as superclass, BUT: > >> __init__ is duplicated, with a single difference: > >> The actual IP shell_class is set to our own subclass. > >> __call__ is split into two methods for setup / teardown. > >> ''' > >> > >> def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None, > >> user_ns=None): > >> """Note that argv here is a string, NOT a list.""" > >> self.set_banner(banner) > >> self.set_exit_msg(exit_msg) > >> self.set_dummy_mode(0) > >> # sys.displayhook is a global, we need to save the user's original > >> # Don't rely on __displayhook__, as the user may have changed that. > >> self.sys_displayhook_ori = sys.displayhook > >> # save readline completer status > >> try: > >> #print 'Save completer',sys.ipcompleter # dbg > >> self.sys_ipcompleter_ori = sys.ipcompleter > >> except: > >> pass # not nested with IPython > >> self.IP = make_IPython(argv,rc_override=rc_override, > >> embedded=True, > >> user_ns=user_ns, > >> ###### HERE IS THE DIFFERENCE -- StefanRank > >> shell_class=TwistedInteractiveShell) > >> # copy our own displayhook also > >> self.sys_displayhook_embed = sys.displayhook > >> # and leave the system's display hook clean > >> sys.displayhook = self.sys_displayhook_ori > >> # don't use the ipython crash handler so that user exceptions aren't > >> # trapped > >> sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors, > >> mode = self.IP.rc.xmode, > >> call_pdb = self.IP.rc.pdb) > >> self.restore_system_completer() > >> > >> def __call__(self,header='',local_ns=None,global_ns=None,dummy=None): > >> # Set global subsystems (display,completions) to our values > >> sys.displayhook = self.sys_displayhook_embed > >> if self.IP.has_readline: > >> self.IP.set_completer() > >> if self.banner and header: > >> format = '%s\n%s\n' > >> else: > >> format = '%s%s\n' > >> banner = format % (self.banner,header) > >> # Call the embedding code with a stack depth of 1 so it can skip over > >> # our call and get the original caller's namespaces. > >> ###### STOP HERE, THIS embed_mainloop DOESN'T BLOCK, RETURN THE SHELL --StefanRank > >> return self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1) > >> > >> def teardown(self): > >> ###### call the code that would have been called at the end of IP.embed_mainloop: > >> self.IP.teardown() > >> ###### This is the code formerly known as: the end of __call__: > >> if self.exit_msg: > >> print self.exit_msg > >> # Restore global systems (display, completion) > >> sys.displayhook = self.sys_displayhook_ori > >> self.restore_system_completer() > >> > >> > >> class TwistedInteractiveShell(InteractiveShell): > >> '''Subclassing to remove raw_input call and provide a callback interface. > >> Copy-pasted and split up code of embed_mainloop, interact, raw_input. > >> ''' > >> > >> def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): > >> # Get locals and globals from caller > >> if local_ns is None or global_ns is None: > >> call_frame = sys._getframe(stack_depth).f_back > >> if local_ns is None: > >> local_ns = call_frame.f_locals > >> if global_ns is None: > >> global_ns = call_frame.f_globals > >> self.user_global_ns = global_ns > >> local_varnames = local_ns.keys() > >> self.user_ns.update(local_ns) > >> if local_ns is None and global_ns is None: > >> self.user_global_ns.update(__main__.__dict__) > >> self.set_completer_frame() > >> self.add_builtins() > >> self.interact(header) > >> return self ###### needed for later calls, interact is now non-blocking > >> > >> def teardown(self): > >> '''This is the code formerly known as: the end of interact and embed_mainloop.''' > >> ##### from interact: > >> # We are off again... > >> __builtin__.__dict__['__IPYTHON__active'] -= 1 > >> ##### from embed_mainloop: > >> # now, purge out the user namespace from anything we might have added > >> # from the caller's local namespace > >> ###### local_varnames not accessible any more, > >> ###### should probably be saved... (TODO) > >> ###delvar = self.user_ns.pop > >> ###for var in local_varnames: > >> ### delvar(var,None) > >> # and clean builtins we may have overridden > >> self.clean_builtins() > >> > >> def interact(self, banner=None): > >> ###### HERE IT GETS HAIRY: code copied from self.interact(header) > >> if self.exit_now: > >> # batch run -> do not interact > >> return ###### This does not make any sense now, since we are non-blocking > >> cprt = 'Type "copyright", "credits" or "license" for more information.' > >> if banner is None: > >> self.write("Python %s on %s\n%s\n(%s)\n" % > >> (sys.version, sys.platform, cprt, > >> self.__class__.__name__)) > >> else: > >> self.write(banner) > >> more = 0 > >> # Mark activity in the builtins > >> __builtin__.__dict__['__IPYTHON__active'] += 1 > >> self.promptForLine(more) > >> return self > >> > >> def promptForLine(self, more): > >> '''New method. To be called before waiting for the next line.''' > >> prompt = '' > >> ###### THIS NEEDED TO BE UNTANGLED: originally a while loop in self.interact > >> # exit_now is set by a call to %Exit or %Quit > >> if not self.exit_now: > >> if more: > >> prompt = self.hooks.generate_prompt(True) > >> if self.autoindent: > >> self.readline_startup_hook(self.pre_readline) > >> else: > >> prompt = self.hooks.generate_prompt(False) > >> ####### code from self.raw_input: > >> self.set_completer() > >> ####### write the prompt here, writing it in the LineReceiver > >> ####### with sendLine messes up the colouring > >> self.write(prompt) > >> ####### raw_input BEGONE!!! > >> ####### unfortunately all the exception handling in self.interact is also gone. > >> ####### return and wait for a call to useLine > >> > >> def useLine(self, line, continue_prompt=False): > >> '''New method. To be called with a new received line.''' > >> ####### code from self.raw_input: > >> if line.strip(): > >> if continue_prompt: > >> self.input_hist_raw[-1] += '%s\n' % line > >> if self.has_readline: # and some config option is set? > >> try: > >> histlen = self.readline.get_current_history_length() > >> newhist = self.input_hist_raw[-1].rstrip() > >> self.readline.remove_history_item(histlen-1) > >> self.readline.replace_history_item(histlen-2,newhist) > >> except AttributeError: > >> pass # re{move,place}_history_item are new in 2.4. > >> else: > >> self.input_hist_raw.append('%s\n' % line) > >> try: > >> lineout = self.prefilter(line,continue_prompt) > >> except: > >> # blanket except, in case a user-defined prefilter crashes, so it > >> # can't take all of ipython with it. > >> self.showtraceback() > >> lineout = '' > >> ###### CODE FROM INTERACT AGAIN: > >> more = self.push(lineout) > >> if (self.SyntaxTB.last_syntax_error and > >> self.rc.autoedit_syntax): > >> self.edit_syntax_error() > >> self.promptForLine(more) > >> ###### indicate if we want to quit > >> return not self.exit_now > >> > >> > >> class ShellProtocol(basic.LineReceiver): > >> delimiter = '\n' # does not work with '\r\n' on Windows... > >> # this might be an issue with the #2157 patches? > >> > >> def __init__(self, ipshell, banner, **kwargs): > >> self.ipshell = ipshell > >> self.banner = banner > >> self.kwargs = kwargs > >> > >> def connectionMade(self): > >> #self.sendLine("Yay, type something!") > >> # locals here are available in the shell: > >> # (but in practice the locals of the ShellProtocol() call site > >> # would be more interesting.) > >> another_strange_local = 'hubabuba' > >> from twisted.internet import reactor > >> self.sheller = self.ipshell(self.banner > >> + '\n quit.....quits via LineReceiver,' > >> + '\n exit()...quits via IPython,' > >> + '\n pause....test pausing the LineReceiver', > >> **self.kwargs) > >> > >> def lineReceived(self, line): > >> if line == 'quit': > >> self.sendLine('OK quitting') > >> self.transport.loseConnection() > >> return > >> if line == 'pause': > >> self.sendLine('OK pausing for 2 seconds') > >> self.pauseProducing() > >> self.clearLineBuffer() > >> # still receives keys typed during the pause, > >> # no matter how many clearLineBuffer()s, I use. > >> # might be a feature of Windows cmd... ? > >> def restart(): > >> self.clearLineBuffer() > >> self.resumeProducing() > >> self.clearLineBuffer() > >> reactor.callLater(2, restart) > >> return > >> #self.sendLine("Echo: " + line) > >> if not self.sheller.useLine(line): # processes line, prints output and next prompt > >> self.sendLine("IPython wants to quit") > >> self.transport.loseConnection() > >> #self.transport.write("Yay, type more!") > >> > >> #def rawDataReceived(self, data): > >> # self.sendLine('RawEcho: ' + str(data)) > >> # self.transport.write("Yay, type more!") > >> > >> def connectionLost(self, reason): > >> try: > >> self.ipshell.teardown() > >> except IOError: > >> pass # is raised by IPython code when you type quit > >> # stop the reactor, only because this is meant to be run in Stdio. > >> reactor.stop() > >> > >> > >> if __name__ == '__main__': > >> main() > >> > >> > >> ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> IPython-dev mailing list > >> IPython-dev at scipy.org > >> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > From jorgen.stenarson at bostream.nu Wed Apr 18 14:37:07 2007 From: jorgen.stenarson at bostream.nu (=?UTF-8?B?SsO2cmdlbiBTdGVuYXJzb24=?=) Date: Wed, 18 Apr 2007 20:37:07 +0200 Subject: [IPython-dev] ipython embedded in twisted, no threads In-Reply-To: <4623F754.9060706@strank.info> References: <4623183F.4070807@strank.info> <4623BD67.4010007@bostream.nu> <4623F754.9060706@strank.info> Message-ID: <46266553.2020602@bostream.nu> Hi Stefan, I have done some more experimenting. And now I think I have something resembling what you were after. If you replace the emacs.py file in pyreadline/modes/emacs.py with the attached version. Then running the async_test.py should give you a prompt where you can type away and at the same time the window title has a counter that is increased every second. Make sure you have a recent update from svn before replacing emacs.py. If you have any suggestions for improving this interface I'm open for suggestions. I'm not sure on the best way to handle Ctrl-D and ctrl-C, especially ctrl-c is problematic since it can be caught by other parts of the program as well. /J?rgen Stefan Rank skrev: > Hi J?rgen, > > on 16.04.2007 20:16 J?rgen Stenarson said the following: >> Hi Stefan, >> >> I'm not sure exactly what you are after (I don't use twisted myself). > > I am not an expert either, I am afraid. > >> But in pyreadline it is now fairly straightforward to add a new >> console class (there are currently two: the standard win32 and one for >> .NET/IronPython) which should implement the lowlevel keyboard and >> screen output routines. If this is what is needed I would be happy to >> accept patches and answer questions to help make it happen. We would >> probably also have to work out a more sofisticated method of choosing >> low-level console backend than what is used now. > > I think what is needed for readline support in twisted is not a new > backend but an additional frontend/API. > The 'problem' (read advantage ;-) with twisted is that it needs a > callback interface that does not block, as it wants to do the polling > for input events itself. > > GNU readline has a callback interface that should be usable for that: > http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC41 > (for triggering single character reading) > Would this be possible with pyreadline? > > cheers, > stefan > >> Stefan Rank skrev: >>> Hi, >>> [apologies if this arrives twice, posting via gmane didn't work - yet.] >>> >>> attached is an ugly first attempt at embedding IPython in a twisted >>> application without using threads. >>> >>> twisted.internet.stdio and a LineReceiver implementation are responsible >>> for getting input events. >>> I had to subclass the IPython shell and rearrange code to >>> create a non-blocking callback interface (splitting on the main, >>> blocking, raw_input call). >>> >>> It's far from perfect: readline functionality is missing (no commandline >>> navigation, history navigation, completion), and sometimes continuation >>> lines eat the input counter (In[2] ... In[4]). >>> >>> Would IPython developers be interested in patches that allow a less ugly >>> version of such a callback-friendly subclass? ;-) >>> The basic idea: refactor the main loop (InteractiveShell.interact) to:: >>> >>> setup() >>> while ...: >>> promptforline() >>> raw_input >>> handleline() >>> teardown() >>> >>> (I think it might also be interesting for the frontend to the IPython >>> parallel computing effort, which uses twisted.) >>> >>> cheers, >>> stefan >>> >>> >>> ------------------------------------------------------------------------ >>> >>> '''Testing a way to embed IPython in a twisted app without using >>> threads. >>> (seems to work on Py25/WinXP, twisted2.5 patched with #2157, >>> IPython0.8.0) >>> >>> twisted.internet.stdio is responsible for getting user input. >>> An implementation of the LineReceiver protocol passes received lines >>> to a custom subclass of the IPython shell (main raw_input call removed). >>> >>> No readline behaviour is available. >>> (But IPython still sets up readline and uses it for colour printing.) >>> >>> TODO: >>> integrate readline functionality: two possibilities >>> >>> 1) Change pyreadline so that it can be called back by t.i.stdio for >>> all things except waiting for input (i.e. completion, key >>> bindings, ...) >>> This would mean no further changes to IPython, which would still >>> be using pyreadline directly. >>> (or use a GNU readline callback interface: a t.i.stdio-alike >>> would be >>> polling/selecting for input, but then call readline to >>> actually consume it.) >>> 2) Build a readline compatible interface for t.i.stdio >>> (only the parts for setting up completeres, key bindings, ...) >>> and make the IPython subclass use that instead of pyreadline >>> >>> As there is a lot of pasted IPython code including comments, I added >>> ##### multi-hash comments and >>> docstrings explaining the rearrangements. >>> >>> :author: strank >>> ''' >>> >>> __docformat__ = "restructuredtext en" >>> >>> import sys >>> import __builtin__ >>> >>> from twisted.internet import reactor, stdio >>> from twisted.protocols import basic >>> from IPython.Shell import IPShellEmbed >>> from IPython.iplib import InteractiveShell, ultraTB >>> from IPython.ipmaker import make_IPython >>> >>> >>> def main(): >>> ###### this is what we want: >>> reactor.callWhenRunning(startTwistedStdioShell) >>> ###### because this blocks the reactor while IPython is active: >>> #reactor.callWhenRunning(startIPShell) >>> reactor.run() >>> >>> >>> def startIPShell(args=None): >>> '''The non-twisted-friendly way of embedding IPython.''' >>> if args is None: >>> args = [] >>> some_recognisable_local = 'WAGAWAGA' # gets exposed in Shell >>> ipshell = IPShellEmbed(args, >>> banner='Standard IPython called from >>> twisted (blocking)', >>> exit_msg='Leaving Interpreter, back to >>> program.') >>> ipshell('***Called from top level. ' >>> 'Hit Ctrl-D to exit interpreter and continue program.') >>> reactor.stop() >>> >>> >>> def startTwistedStdioShell(args=None, local_ns=None): >>> '''On Windows, this only works with a patched twisted, >>> because twisted.internet.stdio in twisted2.5 is unix only, >>> see ticket #2157. >>> ''' >>> if args is None: >>> args = [] >>> ipshell = TwistedIPShellEmbed([], >>> banner='IPython embedded in a >>> Twisted application', >>> exit_msg='Leaving Interpreter, back >>> to program.') >>> sp = ShellProtocol(ipshell, '***Called from top level. ', >>> local_ns=local_ns) >>> #sp.setRawMode() >>> stdio.StandardIO(sp) >>> >>> >>> class TwistedIPShellEmbed(IPShellEmbed): >>> '''Same as superclass, BUT: >>> __init__ is duplicated, with a single difference: >>> The actual IP shell_class is set to our own subclass. >>> __call__ is split into two methods for setup / teardown. >>> ''' >>> >>> def >>> __init__(self,argv=None,banner='',exit_msg=None,rc_override=None, >>> user_ns=None): >>> """Note that argv here is a string, NOT a list.""" >>> self.set_banner(banner) >>> self.set_exit_msg(exit_msg) >>> self.set_dummy_mode(0) >>> # sys.displayhook is a global, we need to save the user's >>> original >>> # Don't rely on __displayhook__, as the user may have changed >>> that. >>> self.sys_displayhook_ori = sys.displayhook >>> # save readline completer status >>> try: >>> #print 'Save completer',sys.ipcompleter # dbg >>> self.sys_ipcompleter_ori = sys.ipcompleter >>> except: >>> pass # not nested with IPython >>> self.IP = make_IPython(argv,rc_override=rc_override, >>> embedded=True, >>> user_ns=user_ns, >>> ###### HERE IS THE DIFFERENCE -- >>> StefanRank >>> shell_class=TwistedInteractiveShell) >>> # copy our own displayhook also >>> self.sys_displayhook_embed = sys.displayhook >>> # and leave the system's display hook clean >>> sys.displayhook = self.sys_displayhook_ori >>> # don't use the ipython crash handler so that user exceptions >>> aren't >>> # trapped >>> sys.excepthook = ultraTB.FormattedTB(color_scheme = >>> self.IP.rc.colors, >>> mode = self.IP.rc.xmode, >>> call_pdb = self.IP.rc.pdb) >>> self.restore_system_completer() >>> >>> def >>> __call__(self,header='',local_ns=None,global_ns=None,dummy=None): >>> # Set global subsystems (display,completions) to our values >>> sys.displayhook = self.sys_displayhook_embed >>> if self.IP.has_readline: >>> self.IP.set_completer() >>> if self.banner and header: >>> format = '%s\n%s\n' >>> else: >>> format = '%s%s\n' >>> banner = format % (self.banner,header) >>> # Call the embedding code with a stack depth of 1 so it can >>> skip over >>> # our call and get the original caller's namespaces. >>> ###### STOP HERE, THIS embed_mainloop DOESN'T BLOCK, RETURN >>> THE SHELL --StefanRank >>> return >>> self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1) >>> >>> def teardown(self): >>> ###### call the code that would have been called at the end >>> of IP.embed_mainloop: >>> self.IP.teardown() >>> ###### This is the code formerly known as: the end of __call__: >>> if self.exit_msg: >>> print self.exit_msg >>> # Restore global systems (display, completion) >>> sys.displayhook = self.sys_displayhook_ori >>> self.restore_system_completer() >>> >>> >>> class TwistedInteractiveShell(InteractiveShell): >>> '''Subclassing to remove raw_input call and provide a callback >>> interface. >>> Copy-pasted and split up code of embed_mainloop, interact, >>> raw_input. >>> ''' >>> >>> def >>> embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): >>> >>> # Get locals and globals from caller >>> if local_ns is None or global_ns is None: >>> call_frame = sys._getframe(stack_depth).f_back >>> if local_ns is None: >>> local_ns = call_frame.f_locals >>> if global_ns is None: >>> global_ns = call_frame.f_globals >>> self.user_global_ns = global_ns >>> local_varnames = local_ns.keys() >>> self.user_ns.update(local_ns) >>> if local_ns is None and global_ns is None: >>> self.user_global_ns.update(__main__.__dict__) >>> self.set_completer_frame() >>> self.add_builtins() >>> self.interact(header) >>> return self ###### needed for later calls, interact is now >>> non-blocking >>> >>> def teardown(self): >>> '''This is the code formerly known as: the end of interact >>> and embed_mainloop.''' >>> ##### from interact: >>> # We are off again... >>> __builtin__.__dict__['__IPYTHON__active'] -= 1 >>> ##### from embed_mainloop: >>> # now, purge out the user namespace from anything we might >>> have added >>> # from the caller's local namespace >>> ###### local_varnames not accessible any more, >>> ###### should probably be saved... (TODO) >>> ###delvar = self.user_ns.pop >>> ###for var in local_varnames: >>> ### delvar(var,None) >>> # and clean builtins we may have overridden >>> self.clean_builtins() >>> >>> def interact(self, banner=None): >>> ###### HERE IT GETS HAIRY: code copied from >>> self.interact(header) >>> if self.exit_now: >>> # batch run -> do not interact >>> return ###### This does not make any sense now, since we >>> are non-blocking >>> cprt = 'Type "copyright", "credits" or "license" for more >>> information.' >>> if banner is None: >>> self.write("Python %s on %s\n%s\n(%s)\n" % >>> (sys.version, sys.platform, cprt, >>> self.__class__.__name__)) >>> else: >>> self.write(banner) >>> more = 0 >>> # Mark activity in the builtins >>> __builtin__.__dict__['__IPYTHON__active'] += 1 >>> self.promptForLine(more) >>> return self >>> >>> def promptForLine(self, more): >>> '''New method. To be called before waiting for the next line.''' >>> prompt = '' >>> ###### THIS NEEDED TO BE UNTANGLED: originally a while loop >>> in self.interact >>> # exit_now is set by a call to %Exit or %Quit >>> if not self.exit_now: >>> if more: >>> prompt = self.hooks.generate_prompt(True) >>> if self.autoindent: >>> self.readline_startup_hook(self.pre_readline) >>> else: >>> prompt = self.hooks.generate_prompt(False) >>> ####### code from self.raw_input: >>> self.set_completer() >>> ####### write the prompt here, writing it in the >>> LineReceiver >>> ####### with sendLine messes up the colouring >>> self.write(prompt) >>> ####### raw_input BEGONE!!! >>> ####### unfortunately all the exception handling in >>> self.interact is also gone. >>> ####### return and wait for a call to useLine >>> >>> def useLine(self, line, continue_prompt=False): >>> '''New method. To be called with a new received line.''' >>> ####### code from self.raw_input: >>> if line.strip(): >>> if continue_prompt: >>> self.input_hist_raw[-1] += '%s\n' % line >>> if self.has_readline: # and some config option is set? >>> try: >>> histlen = >>> self.readline.get_current_history_length() >>> newhist = self.input_hist_raw[-1].rstrip() >>> self.readline.remove_history_item(histlen-1) >>> >>> self.readline.replace_history_item(histlen-2,newhist) >>> except AttributeError: >>> pass # re{move,place}_history_item are new in >>> 2.4. >>> else: >>> self.input_hist_raw.append('%s\n' % line) >>> try: >>> lineout = self.prefilter(line,continue_prompt) >>> except: >>> # blanket except, in case a user-defined prefilter >>> crashes, so it >>> # can't take all of ipython with it. >>> self.showtraceback() >>> lineout = '' >>> ###### CODE FROM INTERACT AGAIN: >>> more = self.push(lineout) >>> if (self.SyntaxTB.last_syntax_error and >>> self.rc.autoedit_syntax): >>> self.edit_syntax_error() >>> self.promptForLine(more) >>> ###### indicate if we want to quit >>> return not self.exit_now >>> >>> >>> class ShellProtocol(basic.LineReceiver): >>> delimiter = '\n' # does not work with '\r\n' on Windows... >>> # this might be an issue with the #2157 patches? >>> >>> def __init__(self, ipshell, banner, **kwargs): >>> self.ipshell = ipshell >>> self.banner = banner >>> self.kwargs = kwargs >>> >>> def connectionMade(self): >>> #self.sendLine("Yay, type something!") >>> # locals here are available in the shell: >>> # (but in practice the locals of the ShellProtocol() call site >>> # would be more interesting.) >>> another_strange_local = 'hubabuba' >>> from twisted.internet import reactor >>> self.sheller = self.ipshell(self.banner >>> + '\n quit.....quits via LineReceiver,' >>> + '\n exit()...quits via IPython,' >>> + '\n pause....test pausing the LineReceiver', >>> **self.kwargs) >>> >>> def lineReceived(self, line): >>> if line == 'quit': >>> self.sendLine('OK quitting') >>> self.transport.loseConnection() >>> return >>> if line == 'pause': >>> self.sendLine('OK pausing for 2 seconds') >>> self.pauseProducing() >>> self.clearLineBuffer() >>> # still receives keys typed during the pause, >>> # no matter how many clearLineBuffer()s, I use. >>> # might be a feature of Windows cmd... ? >>> def restart(): >>> self.clearLineBuffer() >>> self.resumeProducing() >>> self.clearLineBuffer() >>> reactor.callLater(2, restart) >>> return >>> #self.sendLine("Echo: " + line) >>> if not self.sheller.useLine(line): # processes line, prints >>> output and next prompt >>> self.sendLine("IPython wants to quit") >>> self.transport.loseConnection() >>> #self.transport.write("Yay, type more!") >>> >>> #def rawDataReceived(self, data): >>> # self.sendLine('RawEcho: ' + str(data)) >>> # self.transport.write("Yay, type more!") >>> >>> def connectionLost(self, reason): >>> try: >>> self.ipshell.teardown() >>> except IOError: >>> pass # is raised by IPython code when you type quit >>> # stop the reactor, only because this is meant to be run in >>> Stdio. >>> reactor.stop() >>> >>> >>> if __name__ == '__main__': >>> main() >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> IPython-dev mailing list >>> IPython-dev at scipy.org >>> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: async_test.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: emacs.py URL: From fperez.net at gmail.com Wed Apr 18 14:40:47 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 12:40:47 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? Message-ID: Hi all, I just got back from my trip and I'm still behind on email, but I wanted to know if we can cut a release of pyreadline that is fully usable for win32 users. When I left, it seemed the last one I made worked fine in normal usage, but still would throw an exception when run as c:\path\to\ipython foo.py and the exception traceback was remarkably unhelpful. If that got fixed, or can be fixed, it would be nice to announce it so we wrap up the 0.8.0 release on all platforms. Cheers, f From vivainio at gmail.com Wed Apr 18 15:48:37 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 01:18:37 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: Message-ID: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > I just got back from my trip and I'm still behind on email, but I > wanted to know if we can cut a release of pyreadline that is fully > usable for win32 users. > > When I left, it seemed the last one I made worked fine in normal > usage, but still would throw an exception when run as > > c:\path\to\ipython foo.py > > and the exception traceback was remarkably unhelpful. I have fixed IPython so you don't get that horrible recursive traceback when readline is not installed, at least. I guess your exception wasn't this one: C:\ipython>python c:\Python25\Scripts\ipython a.py --------------------------------------------------------------------------- Traceback (most recent call last) : tuple index out of range WARNING: Failure executing file: Python 2.5.1c1 (r251c1:54692, Apr 5 2007, 09:19:18) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.8.1.svn.r2235 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Wed Apr 18 15:52:57 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 13:52:57 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> Message-ID: On 4/18/07, Ville M. Vainio wrote: > On 4/19/07, Fernando Perez wrote: > > > I just got back from my trip and I'm still behind on email, but I > > wanted to know if we can cut a release of pyreadline that is fully > > usable for win32 users. > > > > When I left, it seemed the last one I made worked fine in normal > > usage, but still would throw an exception when run as > > > > c:\path\to\ipython foo.py > > > > and the exception traceback was remarkably unhelpful. > > I have fixed IPython so you don't get that horrible recursive > traceback when readline is not installed, at least. Great, I saw that. thanks. > I guess your exception wasn't this one: > > C:\ipython>python c:\Python25\Scripts\ipython a.py > --------------------------------------------------------------------------- > Traceback (most recent call last) > > > : tuple index out of range Yup. Do you know what it is/how to fix it? It's not visible under *nix, and my win32 setup is currently a doorstop, so I can do precious little about it. Cheers, f From vivainio at gmail.com Wed Apr 18 16:00:19 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 01:30:19 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> Message-ID: <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > Yup. Do you know what it is/how to fix it? It's not visible under > *nix, and my win32 setup is currently a doorstop, so I can do precious > little about it. Yeah, already fixed in svn. I was running python 2.5.1c1, that's why I saw the bug. I got around it by a simple version check. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Wed Apr 18 16:09:30 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 14:09:30 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> Message-ID: On 4/18/07, Ville M. Vainio wrote: > On 4/19/07, Fernando Perez wrote: > > > Yup. Do you know what it is/how to fix it? It's not visible under > > *nix, and my win32 setup is currently a doorstop, so I can do precious > > little about it. > > Yeah, already fixed in svn. > > I was running python 2.5.1c1, that's why I saw the bug. I got around > it by a simple version check. OK, thanks. If everything else is OK, and since this required a fix to ipython itself rather than just pyreadline, perhaps we should quickly cut a 0.8.1 release, that would include an official pyreadline as well. This would make it stable for users on win32, as well as *nix ones without readline (as occasionally happens on OSX or with hand-built pythons). Thoughts? Cheers, f From fperez.net at gmail.com Wed Apr 18 16:10:48 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 14:10:48 -0600 Subject: [IPython-dev] [IPython-user] Windows users: do NOT upgrade to 0.8.0 yet! In-Reply-To: <46cb515a0704151305j61a8762ek625bcd56f79803ae@mail.gmail.com> References: <46cb515a0704151305j61a8762ek625bcd56f79803ae@mail.gmail.com> Message-ID: On 4/15/07, Ville M. Vainio wrote: > Hi Fernando & all, > > > I'm very sorry for the confusion and the time wasted for all. My > > Windows install lives on a computer that died (hardware) this weekend > > so I couldn't do any testing, and our win32 developers who regularly > > work on the platform (Jorgen and Ville) have both been traveling, so I > > completely dropped the ball for that OS. My apology. > > Related to this - things are finally improving on this front, and I > can resume fiddling w/ IPython properly, to give you some slack again. > :-) Great show of flexibility, BTW. Thanks :) But in any case, I'm very happy to have you back on board. My big push meant to catch up with ipython so I could copy trunk into saw, so your return is highly welcome. Cheers, f From vivainio at gmail.com Wed Apr 18 16:38:42 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 02:08:42 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> Message-ID: <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > If everything else is OK, and since this required a fix to ipython > itself rather than just pyreadline, perhaps we should quickly cut a > 0.8.1 release, that would include an official pyreadline as well. Well, I was running pyreadline from the svn so I don't know whether Jorgen had already fixed something. I'm all in favor of a quick 0.8.1, esp. considering that the current version (0.8.0) is totally broken. I think we should do the thing we did before, i.e. put up an unannounced 0.8.1 in the 'testing' directory and let the people here on the mailing list try it out for a few days. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From jorgen.stenarson at bostream.nu Wed Apr 18 16:40:46 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Wed, 18 Apr 2007 22:40:46 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: Message-ID: <4626824E.8000005@bostream.nu> A couple of days ago I sent a patch to the list to address this problem. I have included it again in this mail. It's seems to be a windows ipython problem and not a pyreadline problem. I'm not familiar enough with that code to be sure if my patch is ok in all cases but it fixed this particular problem. I think pyreadline works ok now. I have done a few tweaks but I have not finished the release note yet, I have started to work on it though. I haven't tested the egg-setup in ages either. I'll be gone for a few days now and can check into these things during the weekend. /J?rgen Fernando Perez skrev: > Hi all, > > I just got back from my trip and I'm still behind on email, but I > wanted to know if we can cut a release of pyreadline that is fully > usable for win32 users. > > When I left, it seemed the last one I made worked fine in normal > usage, but still would throw an exception when run as > > c:\path\to\ipython foo.py > > and the exception traceback was remarkably unhelpful. > > If that got fixed, or can be fixed, it would be nice to announce it so > we wrap up the 0.8.0 release on all platforms. > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/applefile Size: 1483 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: iplib.patch Type: application/octet-stream Size: 880 bytes Desc: not available URL: From peter.skomoroch at gmail.com Wed Apr 18 16:41:46 2007 From: peter.skomoroch at gmail.com (Peter Skomoroch) Date: Wed, 18 Apr 2007 16:41:46 -0400 Subject: [IPython-dev] Amazon EC2 and ipython In-Reply-To: <6ce0ac130704181046g538da284oaca942563b145a47@mail.gmail.com> References: <6ce0ac130704181046g538da284oaca942563b145a47@mail.gmail.com> Message-ID: Brian, Thanks for the update 1. What MPI implementation are you using? -I'm using MPICH2 right now, but also have run LAM MPI on EC2...If there are any preferences/dependencies beyond these let me know and I will add the additional libraries. 2. Have you tried mpi4py? At this point it blows all the other python mpi bindings out of the water. I highly recommend it. -No, but I can install mpi4py on the images, no problem. I've tried pypar and have been using pyMPI because it had clean syntax, some good documentation, and it could handle gather/scatter of numpy arrays (which was the main thing I needed). I'm always open to switching to a better library, and I've noticed a bunch of projects using mpi4python. What is the advantage to mpi4py right now? Does it have better performance/ actively developed? 3. Can you make the image publicly available? Sure thing, just let me know when there is a version of ipython1 which is good for a release and I'll post an image to Amazon. On 4/18/07, Brian Granger wrote: > > Peter, > > While I have an EC2 account, I have not gotten around to trying > ipython1 out on it. I would love to see this happen and can help in > any way. But...we are about to release a new version of ipython1 and > I would wait until we have done that. You can watch this list for the > announcement soon. > > Also, two more things: > > 1. What MPI implementation are you using? > > 2. Have you tried mpi4py? At this point it blows all the other > python mpi bindings out of the water. I highly recommend it. > > 3. Can you make the image publicly available? > > Let's keep in touch about this. > > Cheers, > > Brian > > On 4/12/07, Peter Skomoroch wrote: > > I recently posted a tutorial and public Fedora image with MPI, PyMPI, > and > > numpy/scipy for cluster computing on Amazon EC2: > > > > > http://www.datawrangling.com/mpi-cluster-with-python-and-amazon-ec2-part-2-of-3.html > > > > > http://developer.amazonwebservices.com/connect/entry.jspa?externalID=705&categoryID=101 > > > > Has anyone tried running a parallel session with ipython on EC2? Any > > interest in me bundling ipython with the Amazon image? > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivainio at gmail.com Wed Apr 18 16:42:20 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 02:12:20 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> Message-ID: <46cb515a0704181342m459f9cfcs88777f20e3359a98@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > If everything else is OK, and since this required a fix to ipython > itself rather than just pyreadline, perhaps we should quickly cut a > 0.8.1 release, that would include an official pyreadline as well. So how are we going to package pyreadline? Just throw it in the same zipfile? -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Wed Apr 18 16:46:37 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 02:16:37 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <4626824E.8000005@bostream.nu> References: <4626824E.8000005@bostream.nu> Message-ID: <46cb515a0704181346j32b98f97wcc0e046ec7b55ad@mail.gmail.com> On 4/19/07, J?rgen Stenarson wrote: > A couple of days ago I sent a patch to the list to address this problem. > I have included it again in this mail. It's seems to be a windows Yeah, that was the problem area. I have already committed a slightly different fix for the issue (as I said, an explicit version check). -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From dalke at dalkescientific.com Wed Apr 18 19:54:39 2007 From: dalke at dalkescientific.com (Andrew Dalke) Date: Thu, 19 Apr 2007 01:54:39 +0200 Subject: [IPython-dev] headless IPython Message-ID: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> I've got an idea I would like to work on but I'm having a hard time getting started. What I want is an interactive Python session through a web interface. I'm doing this for chemistry so my example is: >>> mol = load_molecule("input_filename") >>> repr(mol) ) >>> mol .======. / \ / \ \\ // \\ // ``-----'' benzene That is, molecule objects are displayed using one of several ways to depict the structure (image, java applet, or plugin, depending on user configuration). This will build up into a larger system, with more data types. For example, ideally I would also like if 'p' were a matplotlib plot then typing 'p' >>> p should inline the plot in the browser display. Very much like Mathematica and similar projects. SAGE has something like this, but the server part of the web-based notebook implementation is not what I want. For example, it doesn't use IPython. It's built around standard exec (at least in 2.0) and the web server code talks to the Python shell instance through 'expect' using a protocol which doesn't seem to handle what I want to do. My thought was to take the value in "_" and use object adaptation to get an adapted/proxy instance that returns a chunk of HTML for display. It would also need to register resources, like images, needed for the display component. I'm getting stuck with how to embed IPython in this sort of case. Everything I see suggests that it really wants to be connected to a terminal, and not to some system which does its own I/O. My system may be a bit esoteric. For something a bit more normal, consider running IPython inside of IDLE or some other system which does its own I/O. How would I do that? I can't find any good examples of this. I'm still working to figure out how all the parts fit together so please correct any misunderstandings/errors you see in what I wrote. Andrew dalke at dalkescientific.com From fperez.net at gmail.com Thu Apr 19 00:47:57 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 22:47:57 -0600 Subject: [IPython-dev] headless IPython In-Reply-To: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> References: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> Message-ID: Hi Andrew, On 4/18/07, Andrew Dalke wrote: > I've got an idea I would like to work on but I'm having > a hard time getting started. a couple of pointers: - http://www.physics.ox.ac.uk/users/santoso/Software.WebLab.html may be of interest to you right away. Someone already asked him on the mpl list if he'd be willing to consider a more mpl/scipy/ipython-friendly license than GPL. I'm pretty sure the edit widget he uses is GPL, but perhaps its original author would be amenable to licensing options if contacted. - in ipython, we're moving in this direction *right now*. This weekend I'll pull the ipython trunk into the saw branch, and we'll begin the work of making the entire ipython be easily pluggable into any event loop (whether twisted's, a custom readline, a gui or whatever). So hopefully ipython will soon provide these capabilities. Next week we'll have a sprint to work on this in Boulder with a group of people, and I hope this will jumpstart our development: http://ipython.scipy.org/moin/Developer_Zone/Sprint Cheers, f From fperez.net at gmail.com Thu Apr 19 01:13:02 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 18 Apr 2007 23:13:02 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> Message-ID: On 4/18/07, Ville M. Vainio wrote: > On 4/19/07, Fernando Perez wrote: > > > If everything else is OK, and since this required a fix to ipython > > itself rather than just pyreadline, perhaps we should quickly cut a > > 0.8.1 release, that would include an official pyreadline as well. > > Well, I was running pyreadline from the svn so I don't know whether > Jorgen had already fixed something. I'm all in favor of a quick 0.8.1, > esp. considering that the current version (0.8.0) is totally broken. Would you care to clarify how exactly the current version is 'totally broken'? As far as I know, we have these bugs (already fixed in SVN and the rc that I just uploaded): 1. crash in *nix when readline is absent. Certainly a serious bug, though not commonly encountered since most *nix setups have readline. 2. error message under win32 when run as c:\path\to\ipython foo.py but it actually otherwise runs. 3. Anything else? In what sense *EXACTLY* is it 'totally broken'? I'd really like to know, since I just finished teaching a 2-day workshop where over 30 people used it intensively for 2 days. I didn't realize they'd been using a 'totally broken' tool all that time. Getting FUD from outsiders is one thing, but getting that from our own developers is a bit surprising, to say the least. Any particular reason we're getting this from you? > I think we should do the thing we did before, i.e. put up an > unannounced 0.8.1 in the 'testing' directory and let the people here > on the mailing list try it out for a few days. I just uploaded test versions at the usual location: http://ipython.scipy.org/dist/testing/ Jorgen, I changed the pyreadline version number just to distinguish it easily, but otherwise just uploaded these straight from your current code. Please have a look at what I did last week, since I was running blind on that code, without a win32 box to test. So if we have no problem reports for a few days, then we can tag and release this as 0.8.1 to clean up the readline problems on all platforms and have something stable for a while. Cheers, f From gael.varoquaux at normalesup.org Thu Apr 19 02:23:13 2007 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Thu, 19 Apr 2007 08:23:13 +0200 Subject: [IPython-dev] headless IPython Message-ID: <20070419062313.GC22826@clipper.ens.fr> On Thu, Apr 19, 2007 at 01:54:39AM +0200, Andrew Dalke wrote: > I've got an idea I would like to work on but I'm having > a hard time getting started. > What I want is an interactive Python session through a web interface. > I'm doing this for chemistry so my example is: > >>> mol = load_molecule("input_filename") > >>> repr(mol) > ) > >>> mol > .======. > / \ > / \ > \\ // > \\ // > ``-----'' > benzene > That is, molecule objects are displayed using one of several > ways to depict the structure (image, java applet, or plugin, > depending on user configuration). > This will build up into a larger system, with more data types. > For example, ideally I would also like if 'p' were a matplotlib > plot then typing 'p' > >>> p > should inline the plot in the browser display. Very much like > Mathematica and similar projects. I am not sure if you are looking for something like pyreport: http://gael-varoquaux.info/computers/pyreport/ It is not interactive, though the last few days I have started reworking its internals to make it useable as a backend for interactive programs. It definitely answers the issue of embedding the MPL plots in a non interactive way. I will add an option to make it print answers from the script as rest strings, so it opens the way to images and co. And this option will be accessible from the script itself (either as comments or with special commands). The code itself is in general of non optimal quality but this is due to the fact that I wrote most of the program when I didn't know python very well. I am (slowly, very slowly) reworking the internals to make them cleaner and more suited for use in backends (maybe one day I'll work on a plugin for ipython). Ga?l From antont at an.org Thu Apr 19 02:56:42 2007 From: antont at an.org (Toni Alatalo) Date: Thu, 19 Apr 2007 09:56:42 +0300 Subject: [IPython-dev] headless IPython In-Reply-To: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> References: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> Message-ID: <462712AA.3050700@an.org> Andrew Dalke kirjoitti: > What I want is an interactive Python session through a web interface. the PyPy project has nice demos of web interfaces to different kinds of python consoles, http://play1.codespeak.net/console/ > >>> repr(mol) > ) > >>> mol > .======. > / \ > / \ > \\ // > \\ // > ``-----'' > benzene > SAGE has something like this, but the server part of the > web-based notebook implementation is not what I want. For nice idea :) in the ipython notebook work we also embedded images to the notebooks, that could be made with an interactive python session. i did not see that 'graphical repr' idea then, though, but iirc we put the plots using explicit commands that ended up in the notebook xml as tags like (that example from http://projects.scipy.org/ipython/ipython/wiki/NotebookXML) i dont know how sage does it, have been a bit out of the loop lately being busy with other kind of work. oh btw that other work has been largely working on 3d graphics and animations using python, and i just now realized (slow me!) that there that sort of visual representations of objects would be awesome! soya3d gui toolkit (called pudding) already ships with an example where a python shell is running inside the opengl using engine, might be well possible to hack that idea there. perhaps also to Blender too. besides shapes/geometry would be handy in previewing colors etc, perhaps layouts or animation algorithms even in those environments. > example, it doesn't use IPython. It's built around standard > exec (at least in 2.0) and the web server code talks to the > Python shell instance through 'expect' using a protocol i dont know the details of how the pypy examples work, like do they use their javascript frontend somehow, but i guess you can take a look in case it seems worthwhile. > Andrew > dalke at dalkescientific.com thanks for sharing the cool idea, and good luck in the efforts to make it work :) ~Toni From vivainio at gmail.com Thu Apr 19 11:13:32 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 20:43:32 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> Message-ID: <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > Would you care to clarify how exactly the current version is 'totally > broken'? As far as I know, we have these bugs (already fixed in SVN > and the rc that I just uploaded): Well, the "initial experience" is very bad on win32, you get an infinite traceback with no real way for a newbie (that probably doesn't have readline installed) to work around it or see what's wrong. That's something that leads to a steady flow of bug reports, so getting a new version out asap is a good idea. > Getting FUD from outsiders is one thing, but getting that from our own > developers is a bit surprising, to say the least. Any particular > reason we're getting this from you? Oh, sorry if it sounded like FUD! The codebase itself is ok, it was just that this one bug we had was of "showstopper" variety on win32. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Thu Apr 19 12:18:55 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 19 Apr 2007 21:48:55 +0530 Subject: [IPython-dev] 0.8.1 is ready in svn Message-ID: <46cb515a0704190918p52a9e7a6ke60cab0bec36f85b@mail.gmail.com> I just changed the version string, and fixed %upgrade a little bit. As far as I'm concerned, it could be uploaded to 'testing' as 0.8.1. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From robert.kern at gmail.com Thu Apr 19 12:40:12 2007 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 19 Apr 2007 11:40:12 -0500 Subject: [IPython-dev] headless IPython In-Reply-To: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> References: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> Message-ID: Andrew Dalke wrote: > I've got an idea I would like to work on but I'm having > a hard time getting started. > > What I want is an interactive Python session through a web interface. > I'm doing this for chemistry so my example is: > > >>> mol = load_molecule("input_filename") > >>> repr(mol) > ) > >>> mol > > .======. > / \ > / \ > \\ // > \\ // > ``-----'' > > benzene > > > That is, molecule objects are displayed using one of several > ways to depict the structure (image, java applet, or plugin, > depending on user configuration). > > This will build up into a larger system, with more data types. > For example, ideally I would also like if 'p' were a matplotlib > plot then typing 'p' > > >>> p > > should inline the plot in the browser display. Very much like > Mathematica and similar projects. It is currently difficult to do something like this in IPython. The code is just too monolithic. I've been desultorily working on an architecture cleanup of IPython that I hope to work out with Fernando and co. at the sprint on the 28th. I had exactly what you describe in mind when I designing it. Basically, I wanted pluggability for the the various execution hooks (sys.displayhook in this case, but also sys.excepthook and sys.stdout/stderr) in order to trap the information where it is being executed (possibly a remote interpreter), format it in potentially multiple ways, and then pass that data back. The core "E" component in "REPL" could then be associated with different "R" and "P" front ends interchangeably. You can take a look at the current stage of the code in my Mercurial repository here: http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/ipwx/ Click "manifest" to browse the repository, "bz2", "zip" or "gz" to get a snapshot, or if you have Mercurial: hg clone http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/ipwx/ Read the README.txt. It uses Enthought's Traits, but it wouldn't be impossible to remove that for the non-UI bits. The code is really a prototype, so there is much to clean up. The wxPython UI stuff should be separated out, of course. Also, very few of IPython's special features have been ported, so it's not even really IPython, yet. This is, of course, one side project among many for me, but if anyone would like to help move this forward, I can certainly put it higher on my stack. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fperez.net at gmail.com Thu Apr 19 13:42:59 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 19 Apr 2007 11:42:59 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> Message-ID: On 4/19/07, Ville M. Vainio wrote: > On 4/19/07, Fernando Perez wrote: > > > Would you care to clarify how exactly the current version is 'totally > > broken'? As far as I know, we have these bugs (already fixed in SVN > > and the rc that I just uploaded): > > Well, the "initial experience" is very bad on win32, you get an > infinite traceback with no real way for a newbie (that probably > doesn't have readline installed) to work around it or see what's > wrong. That's something that leads to a steady flow of bug reports, so > getting a new version out asap is a good idea. That's only true if pyreadline isn't right. A number of users reported on win32 that, except for the little error message at the start, installing BOTH: http://ipython.scipy.org/dist/ipython-0.8.0.win32.exe http://ipython.scipy.org/dist/pyreadline-1.4.2.win32.exe worked just fine. Yes, we had a bug. But a number of users explicitly reported this combination working just fine for them. Having a core developer, on-list, saying that our current release is 'totally broken' in nonsensical, and only serves to scare users away. We have bugs, we fix them, and we announce clearly what the problem and its solution are so people can gauge the severity problem on their own. I am not talking about dismissing or hiding our bugs, but rather about being accurate in describing them. In any case, I just uploaded the 0.8.1 candidate to http://ipython.scipy.org/dist/testing/ so let's give it a few days to simmer before we announce it officially. Jorgen, is that 1.4.3 rc1 OK as well? If so, we'll rename it 1.4.3 and put it out together with 0.8.1 so we have a pair that works well together. Cheers, f From vivainio at gmail.com Thu Apr 19 15:05:42 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 00:35:42 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> Message-ID: <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> On 4/19/07, Fernando Perez wrote: > Having a core developer, on-list, saying that our current release is > 'totally broken' in nonsensical, and only serves to scare users away. Ok, I can admit it was a bit of misguided communication. The basic thrust of the message (to users) was that "stick with the previous version until we release a fixed version a couple of days from now", and hope that nobody got the wrong idea about the general situation of the codebase. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Thu Apr 19 15:52:19 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 19 Apr 2007 13:52:19 -0600 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> Message-ID: On 4/19/07, Ville M. Vainio wrote: > On 4/19/07, Fernando Perez wrote: > > > Having a core developer, on-list, saying that our current release is > > 'totally broken' in nonsensical, and only serves to scare users away. > > Ok, I can admit it was a bit of misguided communication. The basic > thrust of the message (to users) was that "stick with the previous > version until we release a fixed version a couple of days from now", > and hope that nobody got the wrong idea about the general situation of > the codebase. No problem, we all make mistakes. Let's now focus on ensuring that we get a solid release for our win32 users. With the untimely death of my desktop (where I could run win32 under vmware), that particular ball is on your and our willing users court, I'm afraid. If nobody reports any major issues, let's shoot for putting the release out this weekend, does that sound reasonable? Being so small, I can do it in a few minutes, since there's no major changelog to worry about. Cheers, f From olauzanne at gmail.com Thu Apr 19 16:42:55 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Thu, 19 Apr 2007 22:42:55 +0200 Subject: [IPython-dev] Full import completion for ipython Message-ID: Here is a patch for the svn version of ipython that adds a full completion for the imports. With it you can get completion for commands like 'import xml.d' 'from xml.dom import ' or anything else like this. To provide the completion for a module of the kind 'name' I look into all the folders in the sys.path. To provide the completion for a module of the kind 'name1.name2', I import name1. It may have some side effects ... but anyway you're going to import it aren't you ? The patch modify the extensions. So to try it out you need to add an import to your ipy_user_conf.py : from IPython.Extensions import ipy_stock_completers If you like it I may do a patch to integrate it directly in ipython, not just in the extensions. Hope you like it. Olivier Lauzanne -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: patch Type: application/octet-stream Size: 5854 bytes Desc: not available URL: From vivainio at gmail.com Thu Apr 19 17:24:16 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 02:54:16 +0530 Subject: [IPython-dev] Full import completion for ipython In-Reply-To: References: Message-ID: <46cb515a0704191424x4bded073p2ab2aac0df14e7f@mail.gmail.com> On 4/20/07, Olivier Lauzanne wrote: > Here is a patch for the svn version of ipython that adds a full completion > for the imports. Just in time! However, you need to send a new patch (quickly), I got: [ipython]|9> patch -p5 < c:/dl/patch.diff patching file IPython/Extensions/ipy_completers.py Hunk #1 FAILED at 11. Hunk #2 FAILED at 142. Hunk #3 FAILED at 147. Hunk #4 FAILED at 216. Hunk #5 FAILED at 221. Hunk #6 FAILED at 239. 6 out of 6 hunks FAILED -- saving rejects to file IPython/Extensions/ipy_complet ers.py.rej [ipython]|10> > If you like it I may do a patch to integrate it directly in ipython, not > just in the extensions. No, the less stuff we have directly in ipython, the better. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From dalke at dalkescientific.com Thu Apr 19 18:21:28 2007 From: dalke at dalkescientific.com (Andrew Dalke) Date: Fri, 20 Apr 2007 00:21:28 +0200 Subject: [IPython-dev] headless IPython In-Reply-To: References: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> Message-ID: On Apr 19, 2007, at 6:47 AM, Fernando Perez wrote: > a couple of pointers: > > - http://www.physics.ox.ac.uk/users/santoso/Software.WebLab.html > > may be of interest to you right away. I looked at it but quickly ran into a few problems. For example, I ran the demo example and it told me: >>demo sigmoidal Traceback (most recent call last): File "", line 1, in NameError: name 'matlabCompat' is not defined >> There are some other problems I ran into. While it's early code, I think it's not going in the same direction I want to do. > - in ipython, we're moving in this direction *right now*. This > weekend I'll pull the ipython trunk into the saw branch, and we'll > begin the work of making the entire ipython be easily pluggable into > any event loop (whether twisted's, a custom readline, a gui or > whatever). Great! > So hopefully ipython will soon provide these capabilities. Next week > we'll have a sprint to work on this in Boulder with a group of people, > and I hope this will jumpstart our development: > > http://ipython.scipy.org/moin/Developer_Zone/Sprint I'll be in Oxford that Saturday, and with the 8 hour time zone difference I don't think I can participate even virtually. To stress, just in case it wasn't obvious, I would like access to the object in _ and not just it repr. It looks like most people who do this capture sys.stdout and pipe that back to the client, rather than getting the object and possibly doing some sort of adaptation to it. (eg, PIL image instance turned into an inline image. I should have use that as an example yesterday.) Andrew dalke at dalkescientific.com From dalke at dalkescientific.com Thu Apr 19 18:32:05 2007 From: dalke at dalkescientific.com (Andrew Dalke) Date: Fri, 20 Apr 2007 00:32:05 +0200 Subject: [IPython-dev] headless IPython In-Reply-To: <462712AA.3050700@an.org> References: <57532E60-4BB6-43B9-B7D2-33E6AE62ADF6@dalkescientific.com> <462712AA.3050700@an.org> Message-ID: On Apr 19, 2007, at 8:56 AM, Toni Alatalo wrote: > in the ipython notebook work we also embedded images to the > notebooks, that could be made with an interactive python session. i > did not see that 'graphical repr' idea then, though, but iirc we > put the plots using explicit commands that ended up in the notebook > xml as tags like filename="foo.png" caption="This is my fantastic plot."/> (that > example from http://projects.scipy.org/ipython/ipython/wiki/ > NotebookXML) Let me stress here that I'm not talking strictly about an image. If ChemDraw is available and the results adapter is configured for it then I want to see my compound structure using that plugin. Suppose I have a "CSVReader" class, using the csv module for the underlying IO. I was thinking that >>> data = CSVReader("input.dat") >>> data would have an adapter from the CSVReader class into an HTML table, probably with some Javascript for simple sorting, and a download link to get the data formatted for Excel. > i dont know the details of how the pypy examples work, like do they > use their javascript frontend somehow, but i guess you can take a > look in case it seems worthwhile. The PyPy people demoed a vt100 terminal interface written in Javascript with enough support to run basic emacs. I think that would be useful as a wrapper/hook around os.system() and similar calls which want a tty. Andrew dalke at dalkescientific.com From olauzanne at gmail.com Fri Apr 20 02:31:10 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Fri, 20 Apr 2007 08:31:10 +0200 Subject: [IPython-dev] Full import completion for ipython In-Reply-To: <46cb515a0704191424x4bded073p2ab2aac0df14e7f@mail.gmail.com> References: <46cb515a0704191424x4bded073p2ab2aac0df14e7f@mail.gmail.com> Message-ID: Since my eclipse made patch doesn't seem to work, here is a handmade patch with svn diff, as a difference from the trunk. 2007/4/19, Ville M. Vainio : > > On 4/20/07, Olivier Lauzanne wrote: > > > Here is a patch for the svn version of ipython that adds a full > completion > > for the imports. > > Just in time! However, you need to send a new patch (quickly), I got: > > [ipython]|9> patch -p5 < c:/dl/patch.diff > patching file IPython/Extensions/ipy_completers.py > Hunk #1 FAILED at 11. > Hunk #2 FAILED at 142. > Hunk #3 FAILED at 147. > Hunk #4 FAILED at 216. > Hunk #5 FAILED at 221. > Hunk #6 FAILED at 239. > 6 out of 6 hunks FAILED -- saving rejects to file > IPython/Extensions/ipy_complet > ers.py.rej > [ipython]|10> > > > If you like it I may do a patch to integrate it directly in ipython, not > > just in the extensions. > > No, the less stuff we have directly in ipython, the better. > > -- > Ville M. Vainio - vivainio.googlepages.com > blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.diff Type: text/x-patch Size: 4504 bytes Desc: not available URL: From stefan at sun.ac.za Fri Apr 20 02:46:52 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Fri, 20 Apr 2007 08:46:52 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> Message-ID: <20070420064652.GB1971@mentat.za.net> On Thu, Apr 19, 2007 at 01:52:19PM -0600, Fernando Perez wrote: > On 4/19/07, Ville M. Vainio wrote: > > On 4/19/07, Fernando Perez wrote: > > > > > Having a core developer, on-list, saying that our current release is > > > 'totally broken' in nonsensical, and only serves to scare users away. > > > > Ok, I can admit it was a bit of misguided communication. The basic > > thrust of the message (to users) was that "stick with the previous > > version until we release a fixed version a couple of days from now", > > and hope that nobody got the wrong idea about the general situation of > > the codebase. > > No problem, we all make mistakes. Let's now focus on ensuring that we > get a solid release for our win32 users. With the untimely death of > my desktop (where I could run win32 under vmware), that particular > ball is on your and our willing users court, I'm afraid. My vmware system is up and running again, so Ville, let me know if you need a hand testing anything. Cheers St?fan From stefan at sun.ac.za Fri Apr 20 02:46:52 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Fri, 20 Apr 2007 08:46:52 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> Message-ID: <20070420064652.GB1971@mentat.za.net> On Thu, Apr 19, 2007 at 01:52:19PM -0600, Fernando Perez wrote: > On 4/19/07, Ville M. Vainio wrote: > > On 4/19/07, Fernando Perez wrote: > > > > > Having a core developer, on-list, saying that our current release is > > > 'totally broken' in nonsensical, and only serves to scare users away. > > > > Ok, I can admit it was a bit of misguided communication. The basic > > thrust of the message (to users) was that "stick with the previous > > version until we release a fixed version a couple of days from now", > > and hope that nobody got the wrong idea about the general situation of > > the codebase. > > No problem, we all make mistakes. Let's now focus on ensuring that we > get a solid release for our win32 users. With the untimely death of > my desktop (where I could run win32 under vmware), that particular > ball is on your and our willing users court, I'm afraid. My vmware system is up and running again, so Ville, let me know if you need a hand testing anything. Cheers St?fan From gael.varoquaux at normalesup.org Fri Apr 20 03:16:07 2007 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Fri, 20 Apr 2007 09:16:07 +0200 Subject: [IPython-dev] headless IPython Message-ID: <20070420071607.GD28829@clipper.ens.fr> On Fri, Apr 20, 2007 at 12:25:54AM +0200, Andrew Dalke wrote: > >http://gael-varoquaux.info/computers/pyreport/ > Thank you for point it out. I looked at it, but I don't think > it's what I was looking for. > I really do want an interactive web page there. For example, > the display for the molecule should use one of the various > chemistry plugins to display the molecule and allow it to > be rotated. > I would also like to open a CSV or similar file and have > the default view be a mini-spreadsheet table. > One of the tricky points is getting partial feedback during > long compute jobs, along with killing a running function. > Consider: > for i in range(10): > print i > time.sleep(1) > I would like to see the "1" then the "2" then the ... > as they appear, or to within 1/10th of a second, rather > than waiting the full 10 seconds before I see a response. > This is highly interactive, and it doesn't appear that > your code is designed for this. I have been reworking it lately for this purpose. In the latest version of the code that you can retrieve with "bzr branch http://gael-varoquaux.info/pyreport" you can see that part of the chain has been rewriten using iterators. It goes like this (very simplified) blocks = (block for blick in iterblocks(file)) output_list = sandbox(blocks) Both sandbox and iterblocks take iterators, wich means they are suited for on the fly processing of lines (create an file object that has a .next method, and inject your code though the .next method). One problem is that the iterblocks iterator does not return for each ".next()" consumed. This can probably be changed by adding a few "yield None" in clever places. Another solution is to use two threads, a producer and a consumer. The rest of the compile chain has not been rewriten using iterators so far, but I am planning to do this. I am not saying the code is currently suited for what you want, but I think have done a good amount of the work and will keep on working towards that, though quite slowly due to my day work. A lot of the existing code has been writen a while ago, when I was quite new to Python, and does need reworking, but I know how I want to refactor it and I am making slow progress on it. I would really like pyreport to be useable as a back-end for editors and co, and I think this would provide the kind of API you are looking for. Cheers, Ga?l PS: I am re-route the discussion toward the ipython-dev list. I got it off by mistake. From vivainio at gmail.com Fri Apr 20 09:40:00 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 15:40:00 +0200 Subject: [IPython-dev] weird autocall transalation printouts Message-ID: <46cb515a0704200640xa28d51fvf7a87154fe3ba8ad@mail.gmail.com> Anyone know what's going on? I'll look into this later today also. Autocall prints weird translated version of a command... [~]|36> def func(x): pass |..> [~]|37> fun func funzip [~]|37> func(12) [~]|38> func 12 - - - - f u n c [~]|39> -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 09:58:08 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 15:58:08 +0200 Subject: [IPython-dev] New features + Postponing 0.8.1 a little bit Message-ID: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> Hello, I'd like to propose that we postpone 0.8.1 for a few days, until mid-next-week perhaps. Until then, I think windows packages for 0.8.0 should be moved to 'testing' directory in the ftp site. There are some bugs that should be fixed, and I'd also like to expose "Macro" in ipapi, since I think a "macro library" is a cool idea that should be out there in the wild: # some symbian commands bw = ip.Macro("abld build winscw udeb") bb = ip.Macro("bldmake bldfiles") ip.to_user_ns("bw bb") Aliases can already be defined with ip.magic("alias foo c:/doostuff.exe"), but macros can't. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 10:28:14 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 19:58:14 +0530 Subject: [IPython-dev] New features + Postponing 0.8.1 a little bit In-Reply-To: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> References: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> Message-ID: <46cb515a0704200728se99ea9dyd38f2ba4f4101d2c@mail.gmail.com> On 4/20/07, Ville M. Vainio wrote: > There are some bugs that should be fixed, and I'd also like to expose > "Macro" in ipapi, since I think a "macro library" is a cool idea that > should be out there in the wild: Or rather: # create macro in user_ns ip.macro('bb',"abld build winscw udeb") # return macro object mymacro = ip.macro('foo bar') ip.defalias('bb',"abld build winscw udeb") My masterplan is to create an "export" switch to %store that creates an importable python module of all that has been %store'd. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 11:11:14 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 20:41:14 +0530 Subject: [IPython-dev] weird autocall transalation printouts In-Reply-To: <46cb515a0704200640xa28d51fvf7a87154fe3ba8ad@mail.gmail.com> References: <46cb515a0704200640xa28d51fvf7a87154fe3ba8ad@mail.gmail.com> Message-ID: <46cb515a0704200811o24a4a58bt57e1e3b9e8e5db0c@mail.gmail.com> Interestingly, this only happens at my work machine, not at home... hmm... On 4/20/07, Ville M. Vainio wrote: > Anyone know what's going on? I'll look into this later today also. > Autocall prints weird translated version of a command... > > [~]|36> def func(x): pass > |..> > [~]|37> fun > func funzip > [~]|37> func(12) > [~]|38> func 12 > - - - - f u n c > [~]|39> -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 11:13:44 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 20:43:44 +0530 Subject: [IPython-dev] Full import completion for ipython In-Reply-To: References: Message-ID: <46cb515a0704200813p76523c85o76bb903706d64fa3@mail.gmail.com> On 4/20/07, Olivier Lauzanne wrote: > Here is a patch for the svn version of ipython that adds a full completion > for the imports. It's in, and seems to work fine. Your patch seemed to have screwed up line endings. If possible, please try to have all files with LF line endings only. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 11:43:37 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 21:13:37 +0530 Subject: [IPython-dev] %magic? broken in py2.5.1c1 Message-ID: <46cb515a0704200843g59a94c8re50add854351b2a5@mail.gmail.com> Doing %magic? in python 2.5.1c1 causes: C:\ipython\IPython\OInspect.py in pinfo(self, obj, oname, formatter, info, detai l_level) 410 defln = self.__getdef(obj,oname) 411 if defln: --> 412 out.write(header('Definition:\t')+self.format(defln)) 413 414 # Docstrings only in detail 0 mode, since source contains them ( we : cannot concatenate 'str' and 'NoneType' objects -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 11:55:41 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 21:25:41 +0530 Subject: [IPython-dev] %magic? broken in py2.5.1c1 In-Reply-To: <46cb515a0704200843g59a94c8re50add854351b2a5@mail.gmail.com> References: <46cb515a0704200843g59a94c8re50add854351b2a5@mail.gmail.com> Message-ID: <46cb515a0704200855m1ee79f74i441609d04249972a@mail.gmail.com> When I restarted IPython, it worked again. However, there is still an underlying error somewhere, don't know where yet. It seems like PyColorize.parser.format2 returned (None,error) for some reason. format() should check for this instead of feeding it upwards... On 4/20/07, Ville M. Vainio wrote: > Doing %magic? in python 2.5.1c1 causes: > > C:\ipython\IPython\OInspect.py in pinfo(self, obj, oname, formatter, info, detai > l_level) > 410 defln = self.__getdef(obj,oname) > 411 if defln: > --> 412 out.write(header('Definition:\t')+self.format(defln)) > 413 > 414 # Docstrings only in detail 0 mode, since source contains them ( > we > > : cannot concatenate 'str' and 'NoneType' objects > > -- > Ville M. Vainio - vivainio.googlepages.com > blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' > -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Fri Apr 20 12:10:04 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 20 Apr 2007 10:10:04 -0600 Subject: [IPython-dev] weird autocall transalation printouts In-Reply-To: <46cb515a0704200811o24a4a58bt57e1e3b9e8e5db0c@mail.gmail.com> References: <46cb515a0704200640xa28d51fvf7a87154fe3ba8ad@mail.gmail.com> <46cb515a0704200811o24a4a58bt57e1e3b9e8e5db0c@mail.gmail.com> Message-ID: On 4/20/07, Ville M. Vainio wrote: > Interestingly, this only happens at my work machine, not at home... hmm... > > On 4/20/07, Ville M. Vainio wrote: > > > Anyone know what's going on? I'll look into this later today also. > > Autocall prints weird translated version of a command... > > > > [~]|36> def func(x): pass > > |..> > > [~]|37> fun > > func funzip > > [~]|37> func(12) > > [~]|38> func 12 > > - - - - f u n c > > [~]|39> I've never seen that. I wonder if it's a unicode/codepage/font issue. Try changing your terminal font and see if that helps, or the terminal encoding. Weird, f From fperez.net at gmail.com Fri Apr 20 12:14:20 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 20 Apr 2007 10:14:20 -0600 Subject: [IPython-dev] New features + Postponing 0.8.1 a little bit In-Reply-To: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> References: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> Message-ID: On 4/20/07, Ville M. Vainio wrote: > Hello, > > I'd like to propose that we postpone 0.8.1 for a few days, until > mid-next-week perhaps. No problem. > Until then, I think windows packages for 0.8.0 should be moved to > 'testing' directory in the ftp site. Well, are there any problems for win32 if users grab BOTH of http://ipython.scipy.org/dist/pyreadline-1.4.2.win32.exe http://ipython.scipy.org/dist/ipython-0.8.0.win32.exe ? I thought we'd gotten confirmed reports that as long as pyreadline was installed, everything was dandy (short of that c:\path\ipython f.py message which is mostly harmless and probably doesn't occur very often, since most people just start ipython by itself first and then use %run or similar). thoughts? f From vivainio at gmail.com Fri Apr 20 12:46:34 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 22:16:34 +0530 Subject: [IPython-dev] New features + Postponing 0.8.1 a little bit In-Reply-To: References: <46cb515a0704200658o22893122pcaac239523d4138c@mail.gmail.com> Message-ID: <46cb515a0704200946g27d75966rf751406188e1f041@mail.gmail.com> On 4/20/07, Fernando Perez wrote: > thoughts? Well, I got all the changes I thought of making in already, so I don't care either way. We can release this weekend. We might get some problems with '%magic?' later on but that remains to be seen. Incidentally, here's a nice demo of ipy_exportdb (and the new defmacro and defalias): [Extensions]|54> ipy_exportdb.export() import IPython.ipapi ip = IPython.ipapi.get() # === Macros === ip.defmacro('exp', u'reload(ipy_exportdb)\n' u'ipy_exportdb.export()\n' ) ip.defmacro('morjensta', u'print "hei"\n' u'print "moi"\n' ) # === Variables === a = 10 b = 'oaeaoeaoe' ip.to_user_ns("a b") # === Bookmarks === ip.db['bookmarks'] = { 'aoeaoe': 'c:\\Users', 'hai': 'c:\\home', 'hrocau': 'c:\\Users\\Default', 'hui': 'C:\\', 'ipy': 'C:\\ipython'} # === Alias definitions === ip.defalias('d', 'ls -F --color=auto') -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 20 13:37:26 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 20 Apr 2007 23:07:26 +0530 Subject: [IPython-dev] Full import completion for ipython In-Reply-To: <46cb515a0704200813p76523c85o76bb903706d64fa3@mail.gmail.com> References: <46cb515a0704200813p76523c85o76bb903706d64fa3@mail.gmail.com> Message-ID: <46cb515a0704201037l2681854ct22a56a3de92cb9f@mail.gmail.com> On 4/20/07, Ville M. Vainio wrote: > > Here is a patch for the svn version of ipython that adds a full completion > > for the imports. > > It's in, and seems to work fine. It was an understatemant, it works like a charm now that I've played it a bit more. Many thanks, people will surely wonder how they managed w/o import completers before :-). -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Fri Apr 20 20:49:59 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 20 Apr 2007 18:49:59 -0600 Subject: [IPython-dev] IPython dev sprint reminder Message-ID: Hi all, we wanted to remind anyone who may be interested about the IPython coding sprint we'll hold on April 28 in Boulder, Colorado, as part of the regular activities of the Front Range Pythoneers group. We've added some info to the wiki, and will continue to update it: http://ipython.scipy.org/moin/Developer_Zone/Sprint Anyone is welcome to stop by, though we'd appreciate letting us know so we can have a tentative head count in advance. Regards, f From rocky at panix.com Sat Apr 21 07:20:26 2007 From: rocky at panix.com (R. Bernstein) Date: Sat, 21 Apr 2007 07:20:26 -0400 Subject: [IPython-dev] Embedding ipython (and in pydb, of course) Message-ID: <17961.62330.201753.275329@panix3.panix.com> I recently made a change to allow calling ipython inside pydb. (Calling pydb from ipython was previously added.) It was pretty easy to do since there is the IPShellEmbed class. One small problem I noticed had to do with not setting argv on the call while the program I was debugging had imported sys. The error message I was getting from ipmaker.py around line 2156 was: WARNING: Error in Arguments: TypeError('expected a character buffer object',) The program exited via sys.exit(). Exit status: 1 I solved this by setting argv to the options I wanted in the call to IPShellEmbed. Haven't tracked this down further, but I thought I'd mention. Finally if anyone does try the pydb code in CVS, node that a pydb calling ipython which then call %pydb doesn't work due to sys.settrace globalness. Later... From vivainio at gmail.com Sat Apr 21 14:30:31 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Sun, 22 Apr 2007 00:00:31 +0530 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. Message-ID: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> Please see ticket http://projects.scipy.org/ipython/ipython/ticket/146 This should be the only blocker for 0.8.1 now. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From jorgen.stenarson at bostream.nu Sat Apr 21 16:34:30 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Sat, 21 Apr 2007 22:34:30 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704181346j32b98f97wcc0e046ec7b55ad@mail.gmail.com> References: <4626824E.8000005@bostream.nu> <46cb515a0704181346j32b98f97wcc0e046ec7b55ad@mail.gmail.com> Message-ID: <462A7556.9030400@bostream.nu> Ville M. Vainio skrev: > On 4/19/07, J?rgen Stenarson wrote: > >> A couple of days ago I sent a patch to the list to address this problem. >> I have included it again in this mail. It's seems to be a windows > > Yeah, that was the problem area. I have already committed a slightly > different fix for the issue (as I said, an explicit version check). > Well I still see the problem below with the current svn version of ipython (I use python 2.4.3). This problem goes away with my patch. C:\python\ipython>.\ipython.py qq.py --------------------------------------------------------------------------- exceptions.IndexError Traceback (most recent call last) IndexError: tuple index out of range WARNING: Failure executing file: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.8.1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: From jorgen.stenarson at bostream.nu Sat Apr 21 16:45:36 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Sat, 21 Apr 2007 22:45:36 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: References: <46cb515a0704181248x5e38dff7nd33f6d5cb3bc7712@mail.gmail.com> <46cb515a0704181300l4a7c7511pe6de4a002f869125@mail.gmail.com> <46cb515a0704181338p3ef6ee82uc1b382689b08900a@mail.gmail.com> <46cb515a0704190813j5d32b7c7r988c8eb0c22f1967@mail.gmail.com> <46cb515a0704191205x731758a2p20f32a4e463e3719@mail.gmail.com> Message-ID: <462A77F0.6040802@bostream.nu> Fernando Perez skrev: > On 4/19/07, Ville M. Vainio wrote: >> On 4/19/07, Fernando Perez wrote: >> >>> Having a core developer, on-list, saying that our current release is >>> 'totally broken' in nonsensical, and only serves to scare users away. >> Ok, I can admit it was a bit of misguided communication. The basic >> thrust of the message (to users) was that "stick with the previous >> version until we release a fixed version a couple of days from now", >> and hope that nobody got the wrong idea about the general situation of >> the codebase. > > No problem, we all make mistakes. Let's now focus on ensuring that we > get a solid release for our win32 users. With the untimely death of > my desktop (where I could run win32 under vmware), that particular > ball is on your and our willing users court, I'm afraid. > > If nobody reports any major issues, let's shoot for putting the > release out this weekend, does that sound reasonable? Being so small, > I can do it in a few minutes, since there's no major changelog to > worry about. > I think pyreadline is good to go, I just made some changes to release.py to update the project description text. I also did some quick tests using eggsetup and it seems to work. /J?rgen From vivainio at gmail.com Sat Apr 21 17:35:21 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Sun, 22 Apr 2007 03:05:21 +0530 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <462A7556.9030400@bostream.nu> References: <4626824E.8000005@bostream.nu> <46cb515a0704181346j32b98f97wcc0e046ec7b55ad@mail.gmail.com> <462A7556.9030400@bostream.nu> Message-ID: <46cb515a0704211435l525c4894kc31c4e33d6b1f1aa@mail.gmail.com> On 4/22/07, J?rgen Stenarson wrote: > Well I still see the problem below with the current svn version of > ipython (I use python 2.4.3). This problem goes away with my patch. Ok, commit it in that case. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Sat Apr 21 18:09:36 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 21 Apr 2007 16:09:36 -0600 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. In-Reply-To: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> References: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> Message-ID: On 4/21/07, Ville M. Vainio wrote: > Please see ticket > > http://projects.scipy.org/ipython/ipython/ticket/146 > > This should be the only blocker for 0.8.1 now. I haven't been able to see the problem at all. If you happen to see it, could you then try to enable logging? If at that point calling logstart doesn't work anymore, perhaps doing directly _ip.magic("logstart ...") might still work. Having a log of the previous input in a session with the problem might help us understand what's going on. Cheers, f From vivainio at gmail.com Sun Apr 22 10:07:11 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Sun, 22 Apr 2007 19:37:11 +0530 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. In-Reply-To: References: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> Message-ID: <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> On 4/22/07, Nevare Stark wrote: > I know how to reproduce it : > > >>> from inspect import ismodule > >>> ismodule?? > >>> ismodule? > > the second line is important > the third line doesn't crash without the second one Hmm, this doesn't reproduce it for me (python 2.51c1). Does it happen to you every time with this? -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From olauzanne at gmail.com Sun Apr 22 10:13:45 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Sun, 22 Apr 2007 16:13:45 +0200 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. In-Reply-To: <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> References: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> Message-ID: 2007/4/22, Ville M. Vainio : > > On 4/22/07, Nevare Stark wrote: > > > I know how to reproduce it : > > > > >>> from inspect import ismodule > > >>> ismodule?? > > >>> ismodule? > > > > the second line is important > > the third line doesn't crash without the second one > > Hmm, this doesn't reproduce it for me (python 2.51c1). Does it happen > to you every time with this? Yes it happens everytime. And I have python 2.5.1c1 too, but it also happens with 2.4.4. My ipython version is a few days old from svn. Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Sun Apr 22 13:14:11 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 22 Apr 2007 11:14:11 -0600 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. In-Reply-To: <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> References: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> Message-ID: On 4/22/07, Ville M. Vainio wrote: > On 4/22/07, Nevare Stark wrote: > > > I know how to reproduce it : > > > > >>> from inspect import ismodule > > >>> ismodule?? > > >>> ismodule? > > > > the second line is important > > the third line doesn't crash without the second one > > Hmm, this doesn't reproduce it for me (python 2.51c1). Does it happen > to you every time with this? OK, that works for me here (meaning, I see the bug), thanks. With a reproducible case, it's now just a matter of fixing it, I'll try to do it later today. Many thanks for a repeatable case! Cheers, f From jorgen.stenarson at bostream.nu Sun Apr 22 14:57:58 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Sun, 22 Apr 2007 20:57:58 +0200 Subject: [IPython-dev] Status of pyreadline release for win32? In-Reply-To: <46cb515a0704211435l525c4894kc31c4e33d6b1f1aa@mail.gmail.com> References: <4626824E.8000005@bostream.nu> <46cb515a0704181346j32b98f97wcc0e046ec7b55ad@mail.gmail.com> <462A7556.9030400@bostream.nu> <46cb515a0704211435l525c4894kc31c4e33d6b1f1aa@mail.gmail.com> Message-ID: <462BB036.9050004@bostream.nu> Ville M. Vainio skrev: > On 4/22/07, J?rgen Stenarson wrote: > >> Well I still see the problem below with the current svn version of >> ipython (I use python 2.4.3). This problem goes away with my patch. > > Ok, commit it in that case. > Done From steve at shrogers.com Sun Apr 22 17:29:56 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Sun, 22 Apr 2007 15:29:56 -0600 Subject: [IPython-dev] [FRPythoneers] IPython sprint In-Reply-To: References: Message-ID: <462BD3D4.9060506@shrogers.com> I've checked out saw (revision 2266), but get this error message when I try to install it. # python setup.py install Here is ipython1.distutils.sysconfig!!!!!! Traceback (most recent call last): File "setup.py", line 58, in ? package_data = with_package_data, NameError: name 'with_package_data' is not defined # Steve From steve at shrogers.com Mon Apr 23 21:30:30 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Mon, 23 Apr 2007 19:30:30 -0600 Subject: [IPython-dev] [FRPythoneers] IPython sprint In-Reply-To: References: <462BD1A5.5040004@shrogers.com> Message-ID: <462D5DB6.4020003@shrogers.com> Fernando Perez wrote: > On 4/22/07, Steven H. Rogers wrote: >> I've checked out saw (revision 2266), but get this error message when I >> try to install it. >> >> # python setup.py install >> Here is ipython1.distutils.sysconfig!!!!!! >> Traceback (most recent call last): >> File "setup.py", line 58, in ? >> package_data = with_package_data, >> NameError: name 'with_package_data' is not defined > > Could you please update? Brian just fixed it in r2267. > > Sorry 'bout that, > No problem. Someone has to find the bumps in the road. I updated to r2267 and it installs successfully, but "ipcluster -n 4" complains that I don't have twisted.web2 installed. I don't see this dependency documented in INSTALL or the wiki. Is version 0.2 OK, or should we get it from svn? # Steve From fperez.net at gmail.com Tue Apr 24 00:57:52 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Mon, 23 Apr 2007 22:57:52 -0600 Subject: [IPython-dev] [FRPythoneers] IPython sprint In-Reply-To: <462D5DB6.4020003@shrogers.com> References: <462BD1A5.5040004@shrogers.com> <462D5DB6.4020003@shrogers.com> Message-ID: On 4/23/07, Steven H. Rogers wrote: > No problem. Someone has to find the bumps in the road. I updated to > r2267 and it installs successfully, but "ipcluster -n 4" complains that > I don't have twisted.web2 installed. I don't see this dependency > documented in INSTALL or the wiki. Is version 0.2 OK, or should we get > it from svn? Could you please post the actual traceback? That dependency is deliberately NOT listed because we ship with a private copy of web2, so that users only need to install Twisted 2.5 official, without having to resort to any SVN code. So I'd like to see the actual error message to see if we can help you better. Cheers, f From ellisonbg.net at gmail.com Tue Apr 24 02:02:45 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Tue, 24 Apr 2007 00:02:45 -0600 Subject: [IPython-dev] [FRPythoneers] IPython sprint In-Reply-To: <462D5DB6.4020003@shrogers.com> References: <462BD1A5.5040004@shrogers.com> <462D5DB6.4020003@shrogers.com> Message-ID: <6ce0ac130704232302i384fc779je031e4700b8de243@mail.gmail.com> I know what the problem is, but I need to get some sleep. I will fix first thing in the morning. Another thing we can put on the todo list for the sprint - work on our setup.py file!!!! Brian On 4/23/07, Steven H. Rogers wrote: > Fernando Perez wrote: > > On 4/22/07, Steven H. Rogers wrote: > >> I've checked out saw (revision 2266), but get this error message when I > >> try to install it. > >> > >> # python setup.py install > >> Here is ipython1.distutils.sysconfig!!!!!! > >> Traceback (most recent call last): > >> File "setup.py", line 58, in ? > >> package_data = with_package_data, > >> NameError: name 'with_package_data' is not defined > > > > Could you please update? Brian just fixed it in r2267. > > > > Sorry 'bout that, > > > > No problem. Someone has to find the bumps in the road. I updated to > r2267 and it installs successfully, but "ipcluster -n 4" complains that > I don't have twisted.web2 installed. I don't see this dependency > documented in INSTALL or the wiki. Is version 0.2 OK, or should we get > it from svn? > > # Steve > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > From steve at shrogers.com Tue Apr 24 08:14:57 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Tue, 24 Apr 2007 06:14:57 -0600 Subject: [IPython-dev] Missing twisted.web2 traceback In-Reply-To: References: <462BD1A5.5040004@shrogers.com> <462D5DB6.4020003@shrogers.com> Message-ID: <462DF4C1.9010008@shrogers.com> Fernando Perez wrote: > On 4/23/07, Steven H. Rogers wrote: > >> No problem. Someone has to find the bumps in the road. I updated to >> r2267 and it installs successfully, but "ipcluster -n 4" complains that >> I don't have twisted.web2 installed. I don't see this dependency >> documented in INSTALL or the wiki. Is version 0.2 OK, or should we get >> it from svn? > > Could you please post the actual traceback? That dependency is > deliberately NOT listed because we ship with a private copy of web2, > so that users only need to install Twisted 2.5 official, without > having to resort to any SVN code. So I'd like to see the actual error > message to see if we can help you better. > steve at raven:~/tools/ipython$ ipcluster -n 4 Starting controller: Controller PID: 4334 Traceback (most recent call last): File "/usr/bin/ipcontroller", line 24, in ? import ipython1.config.api as config File "/usr/lib/python2.4/site-packages/ipython1/config/api.py", line 63, in ? from ipython1.config.objects import configClasses File "/usr/lib/python2.4/site-packages/ipython1/config/objects.py", line 128, in ? from ipython1.kernel.multienginexmlrpc import \ File "/usr/lib/python2.4/site-packages/ipython1/kernel/multienginexmlrpc.py", line 31, in ? from ipython1.external.twisted.web2 import xmlrpc, server, channel ImportError: No module named external.twisted.web2 Starting engines: Engines PIDs: [4336, 4337, 4338, 4339] Log files: /home/steve/.ipython/log/ipcluster-4334-* Your cluster is up and running. For interactive use, you can make a Remote Controller with: import ipython1.kernel.api as kernel ipc = kernel.RemoteController(('127.0.0.1',10105)) You can then cleanly stop the cluster from IPython using: ipc.killAll(controller=True) You can also hit Ctrl-C to stop it, or use from the cmd line: kill -INT 4333 Traceback (most recent call last): File "/usr/bin/ipengine", line 25, in ? import ipython1.config.api as config File "/usr/lib/python2.4/site-packages/ipython1/config/api.py", line 63, in ? from ipython1.config.objects import configClasses File "/usr/lib/python2.4/site-packages/ipython1/config/objects.py", line 128, in ? from ipython1.kernel.multienginexmlrpc import \ File "/usr/lib/python2.4/site-packages/ipython1/kernel/multienginexmlrpc.py", line 31, in ? from ipython1.external.twisted.web2 import xmlrpc, server, channel ImportError: No module named external.twisted.web2 Traceback (most recent call last): File "/usr/bin/ipengine", line 25, in ? import ipython1.config.api as config File "/usr/lib/python2.4/site-packages/ipython1/config/api.py", line 63, in ? from ipython1.config.objects import configClasses File "/usr/lib/python2.4/site-packages/ipython1/config/objects.py", line 128, in ? from ipython1.kernel.multienginexmlrpc import \ File "/usr/lib/python2.4/site-packages/ipython1/kernel/multienginexmlrpc.py", line 31, in ? from ipython1.external.twisted.web2 import xmlrpc, server, channel ImportError: No module named external.twisted.web2 Traceback (most recent call last): File "/usr/bin/ipengine", line 25, in ? import ipython1.config.api as config File "/usr/lib/python2.4/site-packages/ipython1/config/api.py", line 63, in ? from ipython1.config.objects import configClasses File "/usr/lib/python2.4/site-packages/ipython1/config/objects.py", line 128, in ? from ipython1.kernel.multienginexmlrpc import \ File "/usr/lib/python2.4/site-packages/ipython1/kernel/multienginexmlrpc.py", line 31, in ? from ipython1.external.twisted.web2 import xmlrpc, server, channel ImportError: No module named external.twisted.web2 Traceback (most recent call last): File "/usr/bin/ipengine", line 25, in ? import ipython1.config.api as config File "/usr/lib/python2.4/site-packages/ipython1/config/api.py", line 63, in ? from ipython1.config.objects import configClasses File "/usr/lib/python2.4/site-packages/ipython1/config/objects.py", line 128, in ? from ipython1.kernel.multienginexmlrpc import \ File "/usr/lib/python2.4/site-packages/ipython1/kernel/multienginexmlrpc.py", line 31, in ? from ipython1.external.twisted.web2 import xmlrpc, server, channel ImportError: No module named external.twisted.web2 Stopping cluster. Cleaning up... OK: All processes cleaned up. From ellisonbg.net at gmail.com Tue Apr 24 12:09:59 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Tue, 24 Apr 2007 10:09:59 -0600 Subject: [IPython-dev] [FRPythoneers] IPython sprint In-Reply-To: <6ce0ac130704232302i384fc779je031e4700b8de243@mail.gmail.com> References: <462BD1A5.5040004@shrogers.com> <462D5DB6.4020003@shrogers.com> <6ce0ac130704232302i384fc779je031e4700b8de243@mail.gmail.com> Message-ID: <6ce0ac130704240909s16b8d424t25206dc803c0581a@mail.gmail.com> OK, I have fixed the problems with ipython1 not finding the version of web2 that we ship with ipython1. The problem was that our setup.py file had becom outdating and needed some overhauling. Instead of dealing with distutils, I took the opportunity to make the transition to using setuptools. This will be a much better solution in the long run and it was badly needed. So... Everyone who is planning on attending the sprint on Sat. please do an svn up and try a: python setup.py install and maybe a python setup.py develop This second command will be most useful on Saturday. Please let me know if there are lurking problems with the new setup.py script. Cheers, Brian From fperez.net at gmail.com Tue Apr 24 12:47:43 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 24 Apr 2007 10:47:43 -0600 Subject: [IPython-dev] Missing twisted.web2 traceback In-Reply-To: <462DF4C1.9010008@shrogers.com> References: <462BD1A5.5040004@shrogers.com> <462D5DB6.4020003@shrogers.com> <462DF4C1.9010008@shrogers.com> Message-ID: On 4/24/07, Steven H. Rogers wrote: > Fernando Perez wrote: > > On 4/23/07, Steven H. Rogers wrote: > > > >> No problem. Someone has to find the bumps in the road. I updated to > >> r2267 and it installs successfully, but "ipcluster -n 4" complains that > >> I don't have twisted.web2 installed. I don't see this dependency > >> documented in INSTALL or the wiki. Is version 0.2 OK, or should we get > >> it from svn? > > > > Could you please post the actual traceback? That dependency is > > deliberately NOT listed because we ship with a private copy of web2, > > so that users only need to install Twisted 2.5 official, without > > having to resort to any SVN code. So I'd like to see the actual error > > message to see if we can help you better. Thanks. It seems Brian took care of it already, as per his message. And I now know why I didn't get the error: I don't actually install ipython, I have a few symlinks configured to always run from the raw SVN dir. Since the bug was in setup.py, it never hit me. Sorry for the confusion. Cheers, f From ellisonbg.net at gmail.com Tue Apr 24 13:16:10 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Tue, 24 Apr 2007 11:16:10 -0600 Subject: [IPython-dev] IPython1 Saw alpha1 is released Message-ID: <6ce0ac130704241016i1d50418ao401bee17102d99e5@mail.gmail.com> Hello all, In prepration for the IPython sprint this weeked, we are pleased to announce the first alpha release of IPython1 "Saw". This released has been 6 months in the making and there are many new things. Some places to begin with saw are: * The release notes: http://ipython.scipy.org/moin/IPython1/ReleaseNotes * The start page for parallel computing with IPython1: http://ipython.scipy.org/moin/Parallel_Computing * The source code: svn co http://ipython.scipy.org/svn/ipython/ipython/branches/saw ipython1 We plan on going through a number of alpha releases before declaring "Saw" as stable, so please file bug reports and give us feedback. Cheers, Brian From fperez.net at gmail.com Wed Apr 25 02:30:12 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 25 Apr 2007 00:30:12 -0600 Subject: [IPython-dev] Nice segfault from package scanning... Message-ID: In [4]: import matp [Standby while scanning modules, this can take a while] CXX is installed. The support files you need are in the PYTHON/etc/CXX directory. The include files are in the distutils include path already. Just refer to them as "CXX/CXX_Objects.h", etc. Segmentation fault maqroll[~]> Ville, I noticed you recently added some code that does package scanning after Olivier's patch. I see in http://projects.scipy.org/ipython/ipython/changeset/2254 that this patch doesn't use walk_packages, yet I'm getting that nasty segfault. Any ideas? Unless we can really guarantee that this feature can be made robust, let's make it optional and off by default. I'm not really keen on adding to IPython the tab key as an auto-segfault feature. cheers, f From vivainio at gmail.com Wed Apr 25 02:56:24 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 08:56:24 +0200 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: Message-ID: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> On 4/25/07, Fernando Perez wrote: > In [4]: import matp > > [Standby while scanning modules, this can take a while] You shouldn't see this! It's a message from the old import completer. Please verify that you are running on the latest ipy_completers.py. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Wed Apr 25 10:31:27 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 25 Apr 2007 08:31:27 -0600 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> Message-ID: On 4/25/07, Ville M. Vainio wrote: > On 4/25/07, Fernando Perez wrote: > > > In [4]: import matp > > > > [Standby while scanning modules, this can take a while] > > You shouldn't see this! It's a message from the old import completer. > Please verify that you are running on the latest ipy_completers.py. Yup, I was surprised that I couldn't find that message by grepping the sources. Unfortunately, what happened is that I recently upgraded my laptop to Ubuntu Feisty, and when I typed that message I was inadvertedly running the Feisty IPython, not SVN. It appears that this misfeature was long enough in our tree that it got picked up by the official Feisty IPython (and possibly the Debian one). This is bad: we're quickly going to pick up a really bad rep if Ubuntu users (a good chunk of the desktop linux population) get a long wait and a segfault on every TAB after 'import'. Let's see if we can convince the Debian/Ubuntu maintainers to treat this as a bug and fix it. Can anyone volunteer to make a small patch for this and contact the ubuntu maintainer? It's easy, just disabling that completer is more or less all we need. Furthermore, I'm not convinced even the new, safer package tab-completion should be enabled by default. When used over NFS when your $PYTHONPATH contains many NFS-mounted directories (or other network filesystems), it is very slow. Having your session freeze for a long time just because you hit the tab key isn't very good. Thouhgts? f From vivainio at gmail.com Wed Apr 25 11:51:05 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 21:21:05 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> Message-ID: <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> On 4/25/07, Fernando Perez wrote: > This is bad: we're quickly going to pick up a really bad rep if Ubuntu > users (a good chunk of the desktop linux population) get a long wait > and a segfault on every TAB after 'import'. Let's see if we can > convince the Debian/Ubuntu maintainers to treat this as a bug and fix > it. I don't think there is much convincing - if it segfaults, it's a bug and fixes for it will be accepted. I'd recommend upgrading Ubuntu ipython to 2.8.1 once it's released, they'll get rid of PyColorize format2 bug as well (once it's fixed). It's worse than the broken import completer one because you can refrain from pressing tab after import (because it didn't do anything useful in the first place before the completer). > Furthermore, I'm not convinced even the new, safer package > tab-completion should be enabled by default. When used over NFS when > your $PYTHONPATH contains many NFS-mounted directories (or other > network filesystems), it is very slow. Having your session freeze for > a long time just because you hit the tab key isn't very good. I think this is kinda "special usage" that should not be optimized for. The new import completer is very groovy and I'd like to have it on as a default. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Wed Apr 25 12:05:09 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 25 Apr 2007 10:05:09 -0600 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> Message-ID: On 4/25/07, Ville M. Vainio wrote: > On 4/25/07, Fernando Perez wrote: > > > This is bad: we're quickly going to pick up a really bad rep if Ubuntu > > users (a good chunk of the desktop linux population) get a long wait > > and a segfault on every TAB after 'import'. Let's see if we can > > convince the Debian/Ubuntu maintainers to treat this as a bug and fix > > it. > > I don't think there is much convincing - if it segfaults, it's a bug > and fixes for it will be accepted. > > I'd recommend upgrading Ubuntu ipython to 2.8.1 once it's released, > they'll get rid of PyColorize format2 bug as well (once it's fixed). > It's worse than the broken import completer one because you can > refrain from pressing tab after import (because it didn't do anything > useful in the first place before the completer). Ubuntu, as far as I know, has a policy of not actually changing versions of packages. I could be wrong, but I think they'll only take a small patch that fixes that particular problem, not a version upgrade. Since the format2 bug wasn't in 0.7.3 (which is what they ship), that one is not an issue. > I think this is kinda "special usage" that should not be optimized > for. The new import completer is very groovy and I'd like to have it > on as a default. My policy is to ensure that out of the box, ipython works well, if not 'best', across as wide a user base as possible. NFS filesystems are far from 'special usage' in the unix world: most medium-sized and larger environments I've ever worked at are systematically NFS based. There are already 'nice' features of ipython that we don't ship on by default precisely because they degrade badly in certain cases (verbose exceptions are one such example). While very nice in common usage, they have very poor behavior in not-so-corner cases, and that's very bad. And the package tab-completion is actually very slow even on a local disk if you have a large system install: on my laptop (no NFS), the ipython terminal just freezes for a good 10 seconds just because I touched the TAB key. That behavior is unacceptable, period. IPython has a good reputation for stability and robustness, and we should try hard to keep it that way. Features that, while nice, have very poor behavior (long delays, etc) in reasonable cases will always be off by default. We can then document well exactly how to tweak and customize them for users who'd like a more fine-tuned experience and are aware of the potential risks. Cheers, f From vivainio at gmail.com Wed Apr 25 12:40:30 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 22:10:30 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> Message-ID: <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> On 4/25/07, Fernando Perez wrote: > IPython has a good reputation for stability and robustness, and we > should try hard to keep it that way. Features that, while nice, have > very poor behavior (long delays, etc) in reasonable cases will always > be off by default. We can then document well exactly how to tweak and > customize them for users who'd like a more fine-tuned experience and > are aware of the potential risks. Here's an idea: we remove import of ipy_stock_completers on default profile, and also ship that as a patch to ubuntu. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Wed Apr 25 12:44:40 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 25 Apr 2007 10:44:40 -0600 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> Message-ID: On 4/25/07, Ville M. Vainio wrote: > On 4/25/07, Fernando Perez wrote: > > > IPython has a good reputation for stability and robustness, and we > > should try hard to keep it that way. Features that, while nice, have > > very poor behavior (long delays, etc) in reasonable cases will always > > be off by default. We can then document well exactly how to tweak and > > customize them for users who'd like a more fine-tuned experience and > > are aware of the potential risks. > > Here's an idea: we remove import of ipy_stock_completers on default > profile, and also ship that as a patch to ubuntu. Sounds like a good way to kill two birds with one stone. And the removal can just be a comment-out, with a leading comment explaining what the good feature is and its cost, so users can easily enable it if they want it. Cheers, f From vivainio at gmail.com Wed Apr 25 13:05:14 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 22:35:14 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> Message-ID: <46cb515a0704251005v33629586i8bc03dd456896d3d@mail.gmail.com> On 4/25/07, Fernando Perez wrote: > Sounds like a good way to kill two birds with one stone. And the > removal can just be a comment-out, with a leading comment explaining > what the good feature is and its cost, so users can easily enable it > if they want it. Now, in UserConfig/ipy_user_conf.py we have: def main(): # Handy tab-completers for %cd, %run, import etc. # Try commenting this out if you have completion problems/slowness import ipy_stock_completers The good news is that everyone can disable it without sudo'ing or finding weird files. The bad news is that everyone that has started ipython before the fix is in will have to run %upgrade. I will file a bug report & fix suggestion in Feisty launchpad. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Wed Apr 25 13:18:01 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 22:48:01 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704251005v33629586i8bc03dd456896d3d@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> <46cb515a0704251005v33629586i8bc03dd456896d3d@mail.gmail.com> Message-ID: <46cb515a0704251018r57550587o6193480073298a@mail.gmail.com> On 4/25/07, Ville M. Vainio wrote: > I will file a bug report & fix suggestion in Feisty launchpad. Done, https://bugs.launchpad.net/ubuntu/+source/ipython/+bug/110011 -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From olauzanne at gmail.com Wed Apr 25 13:21:36 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Wed, 25 Apr 2007 19:21:36 +0200 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> Message-ID: > IPython has a good reputation for stability and robustness, and we > should try hard to keep it that way. Features that, while nice, have > very poor behavior (long delays, etc) in reasonable cases will always > be off by default. We can then document well exactly how to tweak and > customize them for users who'd like a more fine-tuned experience and > are aware of the potential risks. First I call root modules modules that are directly in the pythonpath as : xml And I call non root modules modules that are within a package as : xml.dom The completion of a non root module is very fast cause it only do one import and scan one folder. The completion of a root folder is slow (about 2 seconds the first time and then 0.2 seconds on my laptop computer under ubuntu) so this is your problem here One thing I could do is simply break from the function if completion takes more than a few seconds and disable it for the rest of the session. This few seconds would be easily configurable so you could have "slow" completion if you really want it. And that way there would be no stability/robustness issue. Another idea is to scan folders with threads which would be a huge improvement for NFS, but obviously more work than the first solution. Another possibility that I don't really like it to save the root modules, so it would only be slow once. What do you think of the first idea ? with it implemented (which could be real fast) would it be alright to have import completion by default ? Cheers, Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivainio at gmail.com Wed Apr 25 13:44:49 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 23:14:49 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> Message-ID: <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> On 4/25/07, Olivier Lauzanne wrote: > Another possibility that I don't really like it to save the root modules, so > it would only be slow once. It's not really that bad. You can save your stuff e.g in _ip.db['rootmodules'] If you don't know how to use the persistent ipython database _ip.db, see "%bookmark??" What to do with new modules that are added after saving the root modules? I suggest we put del _ip.db['rootmodules'] in %rehashx, which is kinda logical place that won't introduce any new magic commands. [ipython]|80> del _ip.db['rootmodules'] -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Wed Apr 25 14:20:02 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Wed, 25 Apr 2007 23:50:02 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> Message-ID: <46cb515a0704251120y29c27aabtc9ef17c9f7e0c7f7@mail.gmail.com> On 4/25/07, Olivier Lauzanne wrote: > The completion of a root folder is slow (about 2 seconds the first time and > then 0.2 seconds on my laptop computer under ubuntu) so this is your problem > here > > One thing I could do is simply break from the function if completion takes > more than a few seconds and disable it for the rest of the session. This Please implement this, with e.g. 4 sec timeout. I won't promise it'll be on in default profile though, we need more user experience with it before that. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From olauzanne at gmail.com Wed Apr 25 14:31:54 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Wed, 25 Apr 2007 20:31:54 +0200 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> Message-ID: 2007/4/25, Ville M. Vainio : > > On 4/25/07, Olivier Lauzanne wrote: > > > Another possibility that I don't really like it to save the root > modules, so > > it would only be slow once. > > It's not really that bad. You can save your stuff e.g in > > _ip.db['rootmodules'] > > If you don't know how to use the persistent ipython database _ip.db, > see "%bookmark??" > > What to do with new modules that are added after saving the root > modules? I suggest we put > > del _ip.db['rootmodules'] > > in %rehashx, which is kinda logical place that won't introduce any new > magic commands. > > > [ipython]|80> del _ip.db['rootmodules'] shouldn't the rootmodules also be regenerated during the rehash then ? that way there will be no blocking completion even for people with NFS, just a long rehash. and I don't think it's usefull to have both this and a timeout. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivainio at gmail.com Wed Apr 25 14:53:25 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 26 Apr 2007 00:23:25 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> Message-ID: <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> On 4/26/07, Olivier Lauzanne wrote: > shouldn't the rootmodules also be regenerated during the rehash then ? Not necessarily, it would be nice to have all the completion code in one place and only this one trivial thing in %rehashx. > that way there will be no blocking completion even for people with NFS, just > a long rehash. > > and I don't think it's usefull to have both this and a timeout. I'm not so sure. You could print a "creating list of root modules, please wait (this will only be done once - %rehashx to regenerate)" on timeout and store the list - if the list is ready before the timeout, there would be no need to store the list and a "fresh" list could be generated every time. Then you'll have either 1) Fresh and fast module list on normal cases 2) Possibly outdated but fast module list on NFS-cases. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From olauzanne at gmail.com Wed Apr 25 15:03:35 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Wed, 25 Apr 2007 21:03:35 +0200 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> Message-ID: 2007/4/25, Ville M. Vainio : > > > I'm not so sure. You could print a "creating list of root modules, > please wait (this will only be done once - %rehashx to regenerate)" on > timeout and store the list - if the list is ready before the timeout, > there would be no need to store the list and a "fresh" list could be > generated every time. Then you'll have either > > 1) Fresh and fast module list on normal cases > > 2) Possibly outdated but fast module list on NFS-cases. that's a great idea ! I'll do it right now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivainio at gmail.com Wed Apr 25 15:25:46 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 26 Apr 2007 00:55:46 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> Message-ID: <46cb515a0704251225v2e613f72v657f7361a42bf848@mail.gmail.com> On 4/26/07, Olivier Lauzanne wrote: > > generated every time. Then you'll have either > > > > 1) Fresh and fast module list on normal cases > > > > 2) Possibly outdated but fast module list on NFS-cases. > > that's a great idea ! I'll do it right now. Cool. Please also add a scenario where too long an import (20sec?) aborts and writes a marker to db['rootmodules'] which informs the completer never to attempt the generation of rootmodule list again. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From olauzanne at gmail.com Wed Apr 25 17:27:40 2007 From: olauzanne at gmail.com (Olivier Lauzanne) Date: Wed, 25 Apr 2007 23:27:40 +0200 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704251225v2e613f72v657f7361a42bf848@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> <46cb515a0704251225v2e613f72v657f7361a42bf848@mail.gmail.com> Message-ID: 2007/4/25, Ville M. Vainio : > > On 4/26/07, Olivier Lauzanne wrote: > > > > generated every time. Then you'll have either > > > > > > 1) Fresh and fast module list on normal cases > > > > > > 2) Possibly outdated but fast module list on NFS-cases. > > > > that's a great idea ! I'll do it right now. > > Cool. Please also add a scenario where too long an import (20sec?) > aborts and writes a marker to db['rootmodules'] which informs the > completer never to attempt the generation of rootmodule list again. I did it. Here is a new version of ipy_completers.py You will also need to add ip.db.pop('rootmodules',[]) in the %rehashx magic -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ipy_completers.py Type: text/x-python Size: 10620 bytes Desc: not available URL: From fperez.net at gmail.com Wed Apr 25 19:46:44 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 25 Apr 2007 17:46:44 -0600 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: <46cb515a0704251018r57550587o6193480073298a@mail.gmail.com> References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704250851u4ca9907p56c64b94097f769a@mail.gmail.com> <46cb515a0704250940t38cfab49jf4f087894190d0c@mail.gmail.com> <46cb515a0704251005v33629586i8bc03dd456896d3d@mail.gmail.com> <46cb515a0704251018r57550587o6193480073298a@mail.gmail.com> Message-ID: On 4/25/07, Ville M. Vainio wrote: > On 4/25/07, Ville M. Vainio wrote: > > > I will file a bug report & fix suggestion in Feisty launchpad. > > Done, > > https://bugs.launchpad.net/ubuntu/+source/ipython/+bug/110011 Awesome, thanks. f From fperez.net at gmail.com Thu Apr 26 10:43:50 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 26 Apr 2007 08:43:50 -0600 Subject: [IPython-dev] Ticket filed for %magic? breakage, PyColorize mods (format, format2) suspected. In-Reply-To: References: <46cb515a0704211130m29a53ab3y5def0120d5bb5515@mail.gmail.com> <46cb515a0704220707gf2df29di5880afcd8b4af7f0@mail.gmail.com> Message-ID: On 4/22/07, Fernando Perez wrote: > On 4/22/07, Ville M. Vainio wrote: > > On 4/22/07, Nevare Stark wrote: > > > > > I know how to reproduce it : > > > > > > >>> from inspect import ismodule > > > >>> ismodule?? > > > >>> ismodule? > > > > > > the second line is important > > > the third line doesn't crash without the second one > > > > Hmm, this doesn't reproduce it for me (python 2.51c1). Does it happen > > to you every time with this? > > OK, that works for me here (meaning, I see the bug), thanks. > > With a reproducible case, it's now just a matter of fixing it, I'll > try to do it later today. > > Many thanks for a repeatable case! OK, I just closed http://projects.scipy.org/ipython/ipython/ticket/146 with http://projects.scipy.org/ipython/ipython/changeset/2274 I'm not thrilled with the state-handling logic in that format() code, but I wanted a minimally invasive fix for now. Thanks again for providing a solid test case! Cheers, f From ellisonbg.net at gmail.com Thu Apr 26 11:28:43 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Thu, 26 Apr 2007 09:28:43 -0600 Subject: [IPython-dev] [Pytables-users] Failing tests with 2.0rc1 In-Reply-To: <200704261256.43683.faltet@carabos.com> References: <6ce0ac130704251251x6e70f3f6g9e20ce5774928fd5@mail.gmail.com> <200704251332.08655.joshua@eeinternet.com> <200704261256.43683.faltet@carabos.com> Message-ID: <6ce0ac130704260828g671cf27ejad8f25ecf58c52dc@mail.gmail.com> Hi all, Also forwarding this to ipython-dev. I reran the pytables test suite under regular python (not IPython) and all tests pass! For the IPython devs, the issue is that the pytables tests suite (which uses doctest) fails under ipython, but passes under regular python. I think Robert Kern's thoughts about what is going on is probably correct: http://mail.python.org/pipermail/python-list/2006-April/377902.html I will bring this up at the ipython sprint this weekend. Cheers, Brian Python 2.5 (r25:51908, Apr 25 2007, 10:16:50) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. Running .pythonstartup >>> import tables >>> tables.test() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PyTables version: 2.0rc1 HDF5 version: 1.6.5 NumPy version: 1.0.3.dev3673 Zlib version: 1.2.3 BZIP2 version: 1.0.2 (30-Dec-2001) Python version: 2.5 (r25:51908, Apr 25 2007, 10:16:50) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] Platform: darwin-i386 Byte-ordering: little -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Performing only a light (yet comprehensive) subset of the test suite. If you want a more complete test, try passing the --heavy flag to this script (or set the 'heavy' parameter in case you are using tables.test() call). The whole suite will take more than 2 minutes to complete on a relatively modern CPU and around 80 MB of main memory. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Skipping Numeric test suite. Skipping numarray test suite. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /Users/bgranger/txpython-0.1/local/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/tables/filters.py:255: FiltersWarning: compression library ``lzo`` is not available; using ``zlib`` instead % (complib, default_complib), FiltersWarning ) .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. ---------------------------------------------------------------------- Ran 2082 tests in 58.316s OK On 4/26/07, Francesc Altet wrote: > A Dimecres 25 Abril 2007 23:32, Joshua J. Kugler escrigu?: > > On Wednesday 25 April 2007 11:51, Brian Granger wrote: > > > Hi, > > > > > > I just installed pytables 2.0rc1 on my Intel Mac and got many test > > > failures when running tables.test(): > > > > > > I attaching a txt file that has the result of running the test suite. > > > Should I be worried about these failures? > > > > > > Thanks for a fantastic package! > > > > > > Brian > > > > I also got a few failing tests, although not as many as Brian. I also > > noticed that I needed to run the tests as root because test() tries to > > create its hdf5 files under the /var/lib/python2.4 It should use /tmp or > > allow the user to specify a location. Maybe ~/tmp? > > Create temporaries in /var/lib/python2.4? That's bizarre because the PyTables > suite uses the tempfile.mktemp() call in order to create temporaries. I've > double checked that the PyTables suite runs flawlesly even when installed as > root and run as a non-privileged user. Out of curiosity, which is your > output for: > > In [5]: tempfile.mktemp(".h5") > Out[5]: '/tmp/tmph-LUxH.h5' > > ? > > The tests that fails may be due to an old version of HDF5. Can you update to > at least 1.6.5 and run again? > > > I also get many more erors when I run the tests under IPython. > > We are looking into that... > > Cheers, > > -- > >0,0< Francesc Altet http://www.carabos.com/ > V V C?rabos Coop. V. Enjoy Data > "-" > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Pytables-users mailing list > Pytables-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pytables-users > From vivainio at gmail.com Thu Apr 26 12:36:39 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 26 Apr 2007 22:06:39 +0530 Subject: [IPython-dev] Nice segfault from package scanning... In-Reply-To: References: <46cb515a0704242356jb1d7d7dj4b82671596230b32@mail.gmail.com> <46cb515a0704251044q52f079d3k92c64129ba37ccb@mail.gmail.com> <46cb515a0704251153j3ab40784le8aa33e8248212df@mail.gmail.com> <46cb515a0704251225v2e613f72v657f7361a42bf848@mail.gmail.com> Message-ID: <46cb515a0704260936o280a0299x23c909167e440191@mail.gmail.com> On 4/26/07, Olivier Lauzanne wrote: > I did it. > Here is a new version of ipy_completers.py In svn, slightly modified. If you have more mods for this, please do svn up. > You will also need to add > ip.db.pop('rootmodules',[]) > in the %rehashx magic Done. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Thu Apr 26 12:41:00 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 26 Apr 2007 22:11:00 +0530 Subject: [IPython-dev] Time for 0.8.1 (again?) Message-ID: <46cb515a0704260941h4990dbf8t399a83505cf02c1e@mail.gmail.com> Hey, It would seem that the time is ripe for 0.8.1. So if you Fernando could just upload it to 'testing'... -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Thu Apr 26 12:55:35 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 26 Apr 2007 10:55:35 -0600 Subject: [IPython-dev] [Pytables-users] Failing tests with 2.0rc1 In-Reply-To: <1177606417.2817.11.camel@localhost.localdomain> References: <6ce0ac130704251251x6e70f3f6g9e20ce5774928fd5@mail.gmail.com> <200704251332.08655.joshua@eeinternet.com> <200704261256.43683.faltet@carabos.com> <6ce0ac130704260828g671cf27ejad8f25ecf58c52dc@mail.gmail.com> <1177606417.2817.11.camel@localhost.localdomain> Message-ID: On 4/26/07, Francesc Altet wrote: > El dj 26 de 04 del 2007 a les 09:28 -0600, en/na Brian Granger va > escriure: > > Hi all, > > > > Also forwarding this to ipython-dev. > > > > I reran the pytables test suite under regular python (not IPython) and > > all tests pass! > > > > For the IPython devs, the issue is that the pytables tests suite > > (which uses doctest) fails under ipython, but passes under regular > > python. > > To be more specific, PyTables uses mainly the unittest module for the > test suite, but with some excerpts of 'doctests' sparsed in the middle, > and these are the ones that are creating the problems. > > > I think Robert Kern's thoughts about what is going on is probably correct: > > > > http://mail.python.org/pipermail/python-list/2006-April/377902.html > > > > I will bring this up at the ipython sprint this weekend. Yup, I've been aware of this problem for a while now. We'll think about a clean solution... Cheers, f From fperez.net at gmail.com Thu Apr 26 13:41:20 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 26 Apr 2007 11:41:20 -0600 Subject: [IPython-dev] Time for 0.8.1 (again?) In-Reply-To: <46cb515a0704260941h4990dbf8t399a83505cf02c1e@mail.gmail.com> References: <46cb515a0704260941h4990dbf8t399a83505cf02c1e@mail.gmail.com> Message-ID: On 4/26/07, Ville M. Vainio wrote: > Hey, > > It would seem that the time is ripe for 0.8.1. So if you Fernando > could just upload it to 'testing'... Done: http://ipython.scipy.org/dist/testing/ I marked the version number as 0.8.1.rc1 to distinguish it clearly (we should have done that the last time), and in case anything pops up in the next few days while we test. I don't like to upload over the same file number, projects that do that drive me nuts. Jorgen, should we also release pyreadline 1.4.3 as official now? Cheers, f From vivainio at gmail.com Thu Apr 26 14:24:49 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Thu, 26 Apr 2007 23:54:49 +0530 Subject: [IPython-dev] igrid crash on ipwd (windows) Message-ID: <46cb515a0704261124r130e44b2y5a02fdbee1d8b12c@mail.gmail.com> [Console]|5> from ipipe import * [Console]|6> ipwd -----------> ipwd() ...... C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in __init__(self, pane l, input, *attrs) 218 fontsize = 9 219 self.input = input --> 220 self.table = IGridTable(self.input, fontsize, *attrs) 221 self.SetTable(self.table, True) 222 self.SetSelectionMode(wx.grid.Grid.wxGridSelectRows) C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in __init__(self, inpu t, fontsize, *attrs) 129 self._sizing = False 130 self.fontsize = fontsize --> 131 self._fetch(1) 132 133 def GetAttr(self, *args): C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in _fetch(self, count) 177 except Exception, exc: 178 have += 1 --> 179 self._append(item) 180 self.iterator = None 181 break : local variable 'item' referenced before a ssignment -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From jorgen.stenarson at bostream.nu Thu Apr 26 14:50:20 2007 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Thu, 26 Apr 2007 20:50:20 +0200 Subject: [IPython-dev] Time for 0.8.1 (again?) In-Reply-To: References: <46cb515a0704260941h4990dbf8t399a83505cf02c1e@mail.gmail.com> Message-ID: <4630F46C.3030506@bostream.nu> Fernando Perez skrev: > On 4/26/07, Ville M. Vainio wrote: >> Hey, >> >> It would seem that the time is ripe for 0.8.1. So if you Fernando >> could just upload it to 'testing'... > > Done: > > http://ipython.scipy.org/dist/testing/ > > I marked the version number as 0.8.1.rc1 to distinguish it clearly (we > should have done that the last time), and in case anything pops up in > the next few days while we test. I don't like to upload over the same > file number, projects that do that drive me nuts. > > Jorgen, should we also release pyreadline 1.4.3 as official now? > Yes I think that would work. /J?rgen From walter at livinglogic.de Thu Apr 26 16:18:49 2007 From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=) Date: Thu, 26 Apr 2007 22:18:49 +0200 Subject: [IPython-dev] igrid crash on ipwd (windows) In-Reply-To: <46cb515a0704261124r130e44b2y5a02fdbee1d8b12c@mail.gmail.com> References: <46cb515a0704261124r130e44b2y5a02fdbee1d8b12c@mail.gmail.com> Message-ID: <46310929.8050202@livinglogic.de> Ville M. Vainio wrote: > [Console]|5> from ipipe import * > [Console]|6> ipwd > -----------> ipwd() > > ...... > > C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in __init__(self, pane > l, input, *attrs) > 218 fontsize = 9 > 219 self.input = input > --> 220 self.table = IGridTable(self.input, fontsize, *attrs) > 221 self.SetTable(self.table, True) > 222 self.SetSelectionMode(wx.grid.Grid.wxGridSelectRows) > > C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in __init__(self, inpu > t, fontsize, *attrs) > 129 self._sizing = False > 130 self.fontsize = fontsize > --> 131 self._fetch(1) > 132 > 133 def GetAttr(self, *args): > > C:\Python25\Lib\site-packages\IPython\Extensions\igrid.py in _fetch(self, count) > > 177 except Exception, exc: > 178 have += 1 > --> 179 self._append(item) > 180 self.iterator = None > 181 break > > : local variable 'item' referenced before a > ssignment This should be fixed in r2279. Can you try again? (Of course ipwd won't work on Windows anyway, i.e. you'll probably get a browser which displays the AttributeError). Servus, Walter From vivainio at gmail.com Thu Apr 26 16:31:42 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 27 Apr 2007 02:01:42 +0530 Subject: [IPython-dev] igrid crash on ipwd (windows) In-Reply-To: <46310929.8050202@livinglogic.de> References: <46cb515a0704261124r130e44b2y5a02fdbee1d8b12c@mail.gmail.com> <46310929.8050202@livinglogic.de> Message-ID: <46cb515a0704261331k6ae9df3dw1b04560dff5bbe1f@mail.gmail.com> On 4/27/07, Walter D?rwald wrote: > This should be fixed in r2279. Can you try again? > > (Of course ipwd won't work on Windows anyway, i.e. you'll probably get a > browser which displays the AttributeError). Yeah, that's what I get now. But not a crash, which is nice. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 27 05:03:58 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 27 Apr 2007 11:03:58 +0200 Subject: [IPython-dev] weird autocall transalation printouts In-Reply-To: References: <46cb515a0704200640xa28d51fvf7a87154fe3ba8ad@mail.gmail.com> <46cb515a0704200811o24a4a58bt57e1e3b9e8e5db0c@mail.gmail.com> Message-ID: <46cb515a0704270203u44cbd3daub9c6f90cd92ad945@mail.gmail.com> On 4/20/07, Fernando Perez wrote: > > > Autocall prints weird translated version of a command... > > > > > > [~]|36> def func(x): pass > > > |..> > > > [~]|37> fun > > > func funzip > > > [~]|37> func(12) > > > [~]|38> func 12 > > > - - - - f u n c > > > [~]|39> > > I've never seen that. I wonder if it's a unicode/codepage/font issue. > Try changing your terminal font and see if that helps, or the > terminal encoding. It was a pyreadline issue, that was fixed by the new release candidate. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Fri Apr 27 07:25:55 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Fri, 27 Apr 2007 13:25:55 +0200 Subject: [IPython-dev] rc2 Message-ID: <46cb515a0704270425t731883b7r8196fcaafbc03c11@mail.gmail.com> After a few recent changes, igrid and and set_term_title for win32, could you fernando please upload an rc2? -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Fri Apr 27 12:13:16 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 27 Apr 2007 10:13:16 -0600 Subject: [IPython-dev] rc2 In-Reply-To: <46cb515a0704270425t731883b7r8196fcaafbc03c11@mail.gmail.com> References: <46cb515a0704270425t731883b7r8196fcaafbc03c11@mail.gmail.com> Message-ID: On 4/27/07, Ville M. Vainio wrote: > After a few recent changes, igrid and and set_term_title for win32, > could you fernando please upload an rc2? Done, updated up to r2285 (the one you just committed a minute ago). Cheers, f From steve at shrogers.com Sat Apr 28 22:39:52 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Sat, 28 Apr 2007 20:39:52 -0600 Subject: [IPython-dev] IPyhton Wiki Spell Checking Message-ID: <46340578.8080609@shrogers.com> I'm a poor speller and would appreciate it if the wiki admin would help MoinMoin out by pointing it at the system words file. On Fedora 6 the following works. $ cd path/to/wiki/data/dict $ ln -s /usr/share/dict/words . Thanks, Steve From fperez.net at gmail.com Sat Apr 28 23:00:29 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 28 Apr 2007 21:00:29 -0600 Subject: [IPython-dev] IPyhton Wiki Spell Checking In-Reply-To: <46340578.8080609@shrogers.com> References: <46340578.8080609@shrogers.com> Message-ID: On 4/28/07, Steven H. Rogers wrote: > I'm a poor speller and would appreciate it if the wiki admin would help > MoinMoin out by pointing it at the system words file. > > On Fedora 6 the following works. > > $ cd path/to/wiki/data/dict > $ ln -s /usr/share/dict/words . Done, let me know if it works as expected (the dict/ directory didn't exist, so I just made one under data/ in the moin dir)... Cheers, f From steve at shrogers.com Sat Apr 28 23:18:11 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Sat, 28 Apr 2007 21:18:11 -0600 Subject: [IPython-dev] IPyhton Wiki Spell Checking In-Reply-To: References: <46340578.8080609@shrogers.com> Message-ID: <46340E73.5020204@shrogers.com> Fernando Perez wrote: > On 4/28/07, Steven H. Rogers wrote: >> I'm a poor speller and would appreciate it if the wiki admin would help >> MoinMoin out by pointing it at the system words file. >> >> On Fedora 6 the following works. >> >> $ cd path/to/wiki/data/dict >> $ ln -s /usr/share/dict/words . > > Done, let me know if it works as expected (the dict/ directory didn't > exist, so I just made one under data/ in the moin dir)... > Not quite. I forgot that you also have to remove the cached file at: path/to/wiki/data/cache/spellchecker.dict It gets rebuilt with the fist spell check attempt. Regards, Steve From fperez.net at gmail.com Sun Apr 29 00:00:36 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 28 Apr 2007 22:00:36 -0600 Subject: [IPython-dev] IPyhton Wiki Spell Checking In-Reply-To: <46340E73.5020204@shrogers.com> References: <46340578.8080609@shrogers.com> <46340E73.5020204@shrogers.com> Message-ID: On 4/28/07, Steven H. Rogers wrote: > Not quite. I forgot that you also have to remove the cached file at: > > path/to/wiki/data/cache/spellchecker.dict > > It gets rebuilt with the fist spell check attempt. Done, let me know how it goes... f From steve at shrogers.com Sun Apr 29 07:26:21 2007 From: steve at shrogers.com (Steven H. Rogers) Date: Sun, 29 Apr 2007 05:26:21 -0600 Subject: [IPython-dev] IPyhton Wiki Spell Checking In-Reply-To: References: <46340578.8080609@shrogers.com> <46340E73.5020204@shrogers.com> Message-ID: <463480DD.3060105@shrogers.com> Fernando Perez wrote: > On 4/28/07, Steven H. Rogers wrote: >> Not quite. I forgot that you also have to remove the cached file at: >> >> path/to/wiki/data/cache/spellchecker.dict >> >> It gets rebuilt with the fist spell check attempt. > > Done, let me know how it goes... > Works fine now. Thanks. # Steve From vivainio at gmail.com Mon Apr 30 07:14:02 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 30 Apr 2007 13:14:02 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names Message-ID: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> I just added the change http://projects.scipy.org/ipython/ipython/changeset/2297 because it's the second most common cause of ipython crashes, just after KeyboardInterrupt. I guess it could be fixed "properly", but we should get 0.8.1 out real soon now.. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From stefan at sun.ac.za Mon Apr 30 07:59:11 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Mon, 30 Apr 2007 13:59:11 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> Message-ID: <20070430115911.GH3761@mentat.za.net> Hi Ville On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > I just added the change > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > because it's the second most common cause of ipython crashes, just > after KeyboardInterrupt. Why does that crash IPython? I can't get it to malfunction on my system, e.g. In [13]: pickleshare.PickleShareDB('/tmp/? ? ?' + '? ? ?') Out[13]: PickleShareDB('/tmp/? ? ?? ? ?') Do you maybe have a snippet that reproduces this behaviour? Cheers St?fan From stefan at sun.ac.za Mon Apr 30 07:59:11 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Mon, 30 Apr 2007 13:59:11 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> Message-ID: <20070430115911.GH3761@mentat.za.net> Hi Ville On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > I just added the change > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > because it's the second most common cause of ipython crashes, just > after KeyboardInterrupt. Why does that crash IPython? I can't get it to malfunction on my system, e.g. In [13]: pickleshare.PickleShareDB('/tmp/? ? ?' + '? ? ?') Out[13]: PickleShareDB('/tmp/? ? ?? ? ?') Do you maybe have a snippet that reproduces this behaviour? Cheers St?fan From vivainio at gmail.com Mon Apr 30 08:06:36 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 30 Apr 2007 14:06:36 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <20070430115911.GH3761@mentat.za.net> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> Message-ID: <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> On 4/30/07, Stefan van der Walt wrote: > On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > > I just added the change > > > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > > > because it's the second most common cause of ipython crashes, just > > after KeyboardInterrupt. > > Why does that crash IPython? I can't get it to malfunction on my > system, e.g. It crashes for users that have non-ascii chars in their username. Here's a snippit that "works" for me: [D:\ipython]|25> p = pickleshare.Pic pickleshare.PickleShareDB pickleshare.PickleShareLink [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') --------------------------------------------------------------------------- Traceback (most recent call last) D:\ipython\ in () D:\ipython\IPython\Extensions\pickleshare.py in __init__(self, root) 45 def __init__(self,root): 46 """ Return a db object that will manage the specied directory""" ---> 47 self.root = Path(root).expanduser().abspath() 48 if not self.root.isdir(): 49 self.root.makedirs() : 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128) [D:\ipython]|26> -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Mon Apr 30 08:06:36 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 30 Apr 2007 14:06:36 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <20070430115911.GH3761@mentat.za.net> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> Message-ID: <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> On 4/30/07, Stefan van der Walt wrote: > On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > > I just added the change > > > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > > > because it's the second most common cause of ipython crashes, just > > after KeyboardInterrupt. > > Why does that crash IPython? I can't get it to malfunction on my > system, e.g. It crashes for users that have non-ascii chars in their username. Here's a snippit that "works" for me: [D:\ipython]|25> p = pickleshare.Pic pickleshare.PickleShareDB pickleshare.PickleShareLink [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') --------------------------------------------------------------------------- Traceback (most recent call last) D:\ipython\ in () D:\ipython\IPython\Extensions\pickleshare.py in __init__(self, root) 45 def __init__(self,root): 46 """ Return a db object that will manage the specied directory""" ---> 47 self.root = Path(root).expanduser().abspath() 48 if not self.root.isdir(): 49 self.root.makedirs() : 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128) [D:\ipython]|26> -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From stefan at sun.ac.za Mon Apr 30 08:18:15 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Mon, 30 Apr 2007 14:18:15 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> Message-ID: <20070430121815.GI3761@mentat.za.net> On Mon, Apr 30, 2007 at 02:06:36PM +0200, Ville M. Vainio wrote: > On 4/30/07, Stefan van der Walt wrote: > > > On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > > > I just added the change > > > > > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > > > > > because it's the second most common cause of ipython crashes, just > > > after KeyboardInterrupt. > > > > Why does that crash IPython? I can't get it to malfunction on my > > system, e.g. > > It crashes for users that have non-ascii chars in their username. > > Here's a snippit that "works" for me: > > [D:\ipython]|25> p = pickleshare.Pic > pickleshare.PickleShareDB pickleshare.PickleShareLink > [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') It works for me under r2235. First I thought it was a Python 2.5 vs 2.4 thing, but seems to run fine under 2.4 as well. Isn't there a workaround, such as encoding the string properly, that doesn't limit the functionality? Cheers St?fan From stefan at sun.ac.za Mon Apr 30 08:18:15 2007 From: stefan at sun.ac.za (Stefan van der Walt) Date: Mon, 30 Apr 2007 14:18:15 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> Message-ID: <20070430121815.GI3761@mentat.za.net> On Mon, Apr 30, 2007 at 02:06:36PM +0200, Ville M. Vainio wrote: > On 4/30/07, Stefan van der Walt wrote: > > > On Mon, Apr 30, 2007 at 01:14:02PM +0200, Ville M. Vainio wrote: > > > I just added the change > > > > > > http://projects.scipy.org/ipython/ipython/changeset/2297 > > > > > > because it's the second most common cause of ipython crashes, just > > > after KeyboardInterrupt. > > > > Why does that crash IPython? I can't get it to malfunction on my > > system, e.g. > > It crashes for users that have non-ascii chars in their username. > > Here's a snippit that "works" for me: > > [D:\ipython]|25> p = pickleshare.Pic > pickleshare.PickleShareDB pickleshare.PickleShareLink > [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') It works for me under r2235. First I thought it was a Python 2.5 vs 2.4 thing, but seems to run fine under 2.4 as well. Isn't there a workaround, such as encoding the string properly, that doesn't limit the functionality? Cheers St?fan From vivainio at gmail.com Mon Apr 30 08:27:54 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 30 Apr 2007 14:27:54 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <20070430121815.GI3761@mentat.za.net> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> <20070430121815.GI3761@mentat.za.net> Message-ID: <46cb515a0704300527i352bc04cuf90df73ba4950f4d@mail.gmail.com> On 4/30/07, Stefan van der Walt wrote: > > Here's a snippit that "works" for me: > > > > [D:\ipython]|25> p = pickleshare.Pic > > pickleshare.PickleShareDB pickleshare.PickleShareLink > > [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') > > It works for me under r2235. First I thought it was a Python 2.5 vs > 2.4 thing, but seems to run fine under 2.4 as well. Isn't there a > workaround, such as encoding the string properly, that doesn't limit > the functionality? Well, now at least the user is informed how to get around the problem. I'm afraid I don't know enough about unicode to guess how the string should be decoded to unicode properly. If it was easy, it would probably have been done in the path.py module. I wouldn't mind enforcing 7 bit file & directory names myself. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From vivainio at gmail.com Mon Apr 30 08:27:54 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Mon, 30 Apr 2007 14:27:54 +0200 Subject: [IPython-dev] Better reporting for non-ascii home dir names In-Reply-To: <20070430121815.GI3761@mentat.za.net> References: <46cb515a0704300414k3e5057fch20f2c22ab0ba32ed@mail.gmail.com> <20070430115911.GH3761@mentat.za.net> <46cb515a0704300506i6fad5695g92b0ce24aded63eb@mail.gmail.com> <20070430121815.GI3761@mentat.za.net> Message-ID: <46cb515a0704300527i352bc04cuf90df73ba4950f4d@mail.gmail.com> On 4/30/07, Stefan van der Walt wrote: > > Here's a snippit that "works" for me: > > > > [D:\ipython]|25> p = pickleshare.Pic > > pickleshare.PickleShareDB pickleshare.PickleShareLink > > [D:\ipython]|25> p = pickleshare.PickleShareDB('/tmp/?q?q?q') > > It works for me under r2235. First I thought it was a Python 2.5 vs > 2.4 thing, but seems to run fine under 2.4 as well. Isn't there a > workaround, such as encoding the string properly, that doesn't limit > the functionality? Well, now at least the user is informed how to get around the problem. I'm afraid I don't know enough about unicode to guess how the string should be decoded to unicode properly. If it was easy, it would probably have been done in the path.py module. I wouldn't mind enforcing 7 bit file & directory names myself. -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'