From 8656167a9e85e209fba3ff10a0849040e8f1fa74 2008-02-02 22:05:50 From: walter.doerwald Date: 2008-02-02 22:05:50 Subject: [PATCH] A new ipipe table has been added: ialias produces all entries from IPython's alias table. --- diff --git a/IPython/Extensions/ipipe.py b/IPython/Extensions/ipipe.py index 7bb6099..1d2eedf 100644 --- a/IPython/Extensions/ipipe.py +++ b/IPython/Extensions/ipipe.py @@ -138,7 +138,7 @@ from IPython import ipapi __all__ = [ "ifile", "ils", "iglob", "iwalk", "ipwdentry", "ipwd", "igrpentry", "igrp", "icsv", "ix", "ichain", "isort", "ifilter", "ieval", "ienum", - "ienv", "ihist", "icap", "idump", "iless" + "ienv", "ihist", "ialias", "icap", "idump", "iless" ] @@ -1598,6 +1598,34 @@ class ihist(Table): yield line.rstrip("\n") +class Alias(object): + """ + Entry in the alias table + """ + def __init__(self, name, args, command): + self.name = name + self.args = args + self.command = command + + def __xattrs__(self, mode="default"): + return ("name", "args", "command") + + +class ialias(Table): + """ + IPython alias list + + Example:: + + >>> ialias + """ + def __iter__(self): + api = ipapi.get() + + for (name, (args, command)) in api.IP.alias_table.iteritems(): + yield Alias(name, args, command) + + class icsv(Pipe): """ This ``Pipe`` turns the input (with must be a pipe outputting lines diff --git a/doc/ChangeLog b/doc/ChangeLog index 2bb5069..cff94b6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-02-02 Walter Doerwald + + * ipipe.py: A new ipipe table has been added: ialias produces all + entries from IPython's alias table. + 2008-02-01 Fernando Perez * IPython/Shell.py (MTInteractiveShell.runcode): Improve handling