From ce369ff3fabe1a285123ed79e5b90137a49a53f1 2008-03-09 13:35:50 From: Ville M. Vainio Date: 2008-03-09 13:35:50 Subject: [PATCH] Implement __call__ for LA --- diff --git a/IPython/Extensions/ipy_profile_sh.py b/IPython/Extensions/ipy_profile_sh.py index ab817a2..fecfeed 100644 --- a/IPython/Extensions/ipy_profile_sh.py +++ b/IPython/Extensions/ipy_profile_sh.py @@ -118,10 +118,12 @@ def main(): extend_shell_behavior(ip) class LastArgFinder: - """ Allow $LA to work as "last argument of previous command, like $! in bash + """ Allow $LA to work as "last argument of previous command", like $! in bash - To call this in normal IPython code, do str(LA). + To call this in normal IPython code, do LA() """ + def __call__(self): + return str(self) def __str__(self): ip = ipapi.get() for cmd in reversed(ip.IP.input_hist_raw):