Re: Define python hooks

Doug Evans <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAP9bCMRuOuDzXUcnuCGuGixT373HZv0LPt4UWERoNjbBWMXzYw@mail.gmail.com>
On Sat, Oct 25, 2014 at 2:08 AM, nojhan <[email protected]> wrote:
> Hello,
>
> I'm currently using several of hook-* and hookpost-* functions with
> shell commands.
> I was wondering if there was a way to define such hooks in pure python.
>
> For instance, I would like to import a module at startup and use it
> across all the hooks to manipulate the output of the hooked commands.

Hi.

While one can't directly define hooks in python, one can still invoke
python from hooks.

E.g.

define hookpost-step
python
... python code ...
end
end
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.