;ò
ÎÑAHc           @   si   d  Z  d k Z d k Z e i i ƒ  Z g  a d „  Z d „  Z	 e i
 d e	 d d ƒe i d e ƒ d S(   s|   Fun magic line editor for ipython 

Use this to easily edit lists of strings gradually without crafting long 
list comprehensions.

'l' is the magic variable name for every line (array element). Save the current 
result (or more exactly, retrieve the last ipython computation result into
%led work area) by running '%led s'. Just run '%led' to show the current work
area data.

Example use:

[ipython]|25> setups = !ls *setup*.py
 ==
['eggsetup.py', 'setup.py', 'setup_bdist_egg.py']
[ipython]|26> setups
         <26> ['eggsetup.py', 'setup.py', 'setup_bdist_egg.py']
[ipython]|27> %led s
Data set from last result (_)
         <27> ['eggsetup.py', 'setup.py', 'setup_bdist_egg.py']
[ipython]|28> %led upper
cmd translated => l.upper()
         <28> ['EGGSETUP.PY', 'SETUP.PY', 'SETUP_BDIST_EGG.PY']
[ipython]|29> %led
Magic line editor (for lists of strings)
current data is:
['eggsetup.py', 'setup.py', 'setup_bdist_egg.py']
[ipython]|30> %led upper
cmd translated => l.upper()
         <30> ['EGGSETUP.PY', 'SETUP.PY', 'SETUP_BDIST_EGG.PY']
[ipython]|31> %led s
Data set from last result (_)
         <31> ['EGGSETUP.PY', 'SETUP.PY', 'SETUP_BDIST_EGG.PY']
[ipython]|32> %led "n:" + l
         <32> ['n:EGGSETUP.PY', 'n:SETUP.PY', 'n:SETUP_BDIST_EGG.PY']
[ipython]|33> %led s
Data set from last result (_)
         <33> ['n:EGGSETUP.PY', 'n:SETUP.PY', 'n:SETUP_BDIST_EGG.PY']
[ipython]|34> %led l.
l.__add__          l.__gt__           l.__reduce_ex__    l.endswith         l.join             l.rstrip
l.__class__        l.__hash__         l.__repr__         l.expandtabs       l.ljust            l.split

... (completions for string variable shown ) ...

Nc         C   s÷   | o4 d GHt o d GHt i t ƒ n d GHd GHd  Sn | d j o t i d ƒ a d GHt } n‰ | i ƒ  o d | d	 } d
 G| GHn g  } xW t D]O } y t | ƒ } Wn) t
 j
 o } d G| Gd G| GHqœ n X| i | ƒ qœ W| Sd  S(   Ns(   Magic line editor (for lists of strings)s   current data is:s6   No current data, you should set it by running '%led s's:   When you have your data in _ (result of last computation).s   ss   _s   Data set from last result (_)s   l.s   ()s   cmd translated =>s   Dropping exceptions   on line:(   s   cmds   curdatas   pprints   ips   evs   newliness   isalphas   ls   evals   l2s	   Exceptions   es   append(   s   selfs   cmds   es   ls   l2s   newlines(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ledit.pys   line_edit_f4   s4     
 c         C   sƒ   | i i d ƒ o3 g  i } t d ƒ D] } | d | ƒ q' ~ Sn t d ƒ g  i } t d ƒ D] } | d | ƒ qc ~ Sd S(   s(    Show all string methods in completions s   l.s    N(   s   events   symbols
   startswiths   appends   _[1]s   dirs   func(   s   selfs   events   _[1]s   func(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ledit.pys   line_edit_complete_fY   s     3s   complete_commands   str_keys   %leds   led(   s   __doc__s   IPython.ipapis   IPythons   pprints   ipapis   gets   ips   curdatas   line_edit_fs   line_edit_complete_fs   set_hooks   expose_magic(   s   ips   pprints   line_edit_complete_fs   IPythons   line_edit_f(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ledit.pys   ?-   s   			%	