[Geany-devel] Keybindings for GeanyPy

Lex Trotman elextr at xxxxx
Sat Aug 6 06:01:15 UTC 2011

On 6 August 2011 15:05, Matthew Brush <mbrush at codebrainz.ca> wrote:
> On 08/05/11 21:32, Lex Trotman wrote:
>> Sounds fair, I havn't used more than about 2Gb of my 4Gb that I have
>> noticed, despite firefox's best efforts.
>> BTW what are the restrictions on what Python can be used when Geany
>> calls a Python callback, I guess everything has to be a function that
>> runs to completion.  Can it be a closure, can it use yield, can it use
>> threads, can it do async I/O so as not to block Geany?
> More or less anything Python itself supports, including Global Interpreter
> Lock [1].  GeanyPy pretty much only the Python X.X interpreter, and
> pre-loades the Geany Python package (written in C) which glues Geany's C API
> to Python's C API.
> [1] http://wiki.python.org/moin/GlobalInterpreterLock

Ok, so my Python plugin can start an I/O bound thread in its
plugin_init routine and have that thread call a Geany function like
updating the status bar when the I/O completes?

Be very careful, both answers are wrong ;-)

And from your next post:

> I forgot to mention, for callbacks, I was thinking of using PyGTK/Gobject-introspection on the GeanyObject which has all the signals on it (IIR).  So plugins would do:

>   geany.object.connect('document-open', on_document_open_handler)

Does that allow on_document_open_handler() to be a bound member function?


PS I'm not intending to be negative about Geany Python plugins, great
idea, but from experience I think you will find some wrinkles in the
real world.

More information about the Devel mailing list