Re: Interpreter-like help in cmd.Cmd

2005-06-26 Thread Bengt Richter
On Thu, 09 Jun 2005 16:53:17 -0700, Sarir Khamsi <[EMAIL PROTECTED]> wrote: >Peter Hansen <[EMAIL PROTECTED]> writes: > >> class _Helper(object): >> """Define the built-in 'help'. >> This is a wrapper around pydoc.help (with a twist). >> >> """ >> >> def __repr__(self): >>

Re: Interpreter-like help in cmd.Cmd

2005-06-09 Thread Peter Hansen
Sarir Khamsi wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: > >>class _Helper(object): ... >> def __call__(self, *args, **kwds): >> import pydoc >> return pydoc.help(*args, **kwds) > > Thanks, but how do I integrate this with cmd.Cmd? I can't say exactly. That might depen

Re: Interpreter-like help in cmd.Cmd

2005-06-09 Thread Sarir Khamsi
Peter Hansen <[EMAIL PROTECTED]> writes: > class _Helper(object): > """Define the built-in 'help'. > This is a wrapper around pydoc.help (with a twist). > > """ > > def __repr__(self): > return "Type help() for interactive help, " \ > "or help(object) f

Re: Interpreter-like help in cmd.Cmd

2005-06-09 Thread Peter Hansen
Sarir Khamsi wrote: > Is there a way to get help the way you get it from the Python > interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the > module cmd.Cmd? I know how to add commands and help text to cmd.Cmd > but I would also like to get the man-page-like help for classes and > fu

Interpreter-like help in cmd.Cmd

2005-06-09 Thread Sarir Khamsi
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how