[IPython-user] pysh variable substituion and scope

Krishna Mohan Gundu gkmohan at gmail.com
Thu Jun 8 05:02:23 CDT 2006


Hello Ville and Fernando,

Here is the patch. It works for the previous example I sent. I am
confident that the patch is robust (but who knows!?) for variable
substitution as I tried to handle all exceptions. The patch also
includes new runlines routine which handles multiline commands. But
like I said before please check if the line numbering is handled
properly and ofcourse if any checks are required on buffer size.

Please keep me updated on the auto exit feature. I need it very soon.

cheers,
Krishna.

PS: the diff from the root of module

On 6/7/06, Krishna Mohan Gundu <gkmohan at gmail.com> wrote:
> Give me time till the end of this week. I will put it in sh profile.
>
> On 6/7/06, Fernando Perez <fperez.net at gmail.com> wrote:
> > On 6/7/06, Ville Vainio <vivainio at gmail.com> wrote:
> > > On 6/5/06, Fernando Perez <fperez.net at gmail.com> wrote:
> > >
> > > > whatever), and add your modifications there.  You can monkeypatch the
> > > > ipython object to inject your enhanced ipsystem() method, as well as
> > > > doing anything else you want to propose.
> > >
> > > Or less drastically, reassign _ip.system to point to a homebrewed
> > > system invocation with stack frame traversal etc. :
> > >
> > > [~\_ipython]|42> ip = IPython.ipapi.get()
> > > [~\_ipython]|43> def f(*args): print "hi",args
> > >             |..>
> > > [~\_ipython]|44> ip.system = f
> > > [~\_ipython]|45> ls
> > > hi ('ls.exe ',)
> >
> > Yes, that's what I meant.  I guess monkeypatching refers more to
> > directly patching the underlying library instead of a running
> > instance, but that's exactly what I had in mind.
> >
> > Cheers,
> >
> > f
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipy_profile_sh.py.diff
Type: text/x-patch
Size: 4663 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/ipython-user/attachments/20060608/5491d39d/attachment.bin 


More information about the IPython-user mailing list