From b9058413a207a8e048b04ebc9fbae8e2e6ca152a 2012-05-26 03:20:00 From: Fernando Perez Date: 2012-05-26 03:20:00 Subject: [PATCH] Update mglob to new magic API. --- diff --git a/IPython/external/mglob/_mglob.py b/IPython/external/mglob/_mglob.py index 8605650..f4da11c 100644 --- a/IPython/external/mglob/_mglob.py +++ b/IPython/external/mglob/_mglob.py @@ -210,17 +210,23 @@ def main(): print "\n".join(expand(sys.argv[1:])), -def mglob_f(self, arg): + +def mglob(self, arg): from IPython.utils.text import SList if arg.strip(): return SList(expand(arg)) print "Please specify pattern!" print globsyntax + +mglob.__doc__ = globsyntax + + def init_ipython(ip): """ register %mglob for IPython """ - mglob_f.__doc__ = globsyntax - ip.define_magic("mglob",mglob_f) + + ip.function_as_magic(mglob) + # test() if __name__ == "__main__":