From 6031457336f07e56fe25f01780063b0b780d90ae 2007-08-07 13:30:56 From: vivainio Date: 2007-08-07 13:30:56 Subject: [PATCH] %macro w/o args returns list of available macros --- diff --git a/IPython/Magic.py b/IPython/Magic.py index d87a66f..d670204 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2569 2007-07-31 19:48:00Z fperez $""" +$Id: Magic.py 2592 2007-08-07 13:30:56Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -1754,6 +1754,8 @@ Currently the magic system has the following functions:\n""" In [60]: exec In[44:48]+In[49]""" opts,args = self.parse_options(parameter_s,'r',mode='list') + if not args: + return [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)] name,ranges = args[0], args[1:] #print 'rng',ranges # dbg lines = self.extract_input_slices(ranges,opts.has_key('r'))