Re: [Rhythmbox-devel] howto: reload plugin without restarting rb + autocompletion for rb module

On Sat, Feb 27, 2010 at 8:54 PM, Christophe Oosterlynck
<tiftof gmail com> wrote:
> Hi,
> I just started out learning about making Rhythmbox Python plugins, but
> I have two annoyances:
> - Every time I change the code of my plugin a little, I have to
> restart Rhythmbox for it to see and load my new code.
> Enabling/disabling the plugin just reloads the code as it was when rb
> launched. Is there a faster way to reload the new code of a plugin
> without restarting rb?

Unfortunately, no. If you start rhythmbox with an alternate database
file (rhythmbox --rhythmdb-file=/tmp/blah.xml) it takes much less time
to start up, which helps to some extent. Disabling plugins (other than
the one you're working on, of course) also helps.

> - I can't seem to enable autocompletion for the "rb" module used for
> Python plugins. I realize that the rb module doesn't really seem to
> exist outside of Rhythmbox. Even though, is there a way to enable
> autocompletion (in whatever IDE)? It would help a beginner to see all
> the possibilities in the rb module.

I can see a couple of possibilities here. It may be possible to build
a python module shared library that loads librhythmbox-core and
initializes the bindings, which you could then import into your IDE.
Or, a tool that parsed the bindings definition files and created stub
python code would probably work too.

On a related note, there has been some interest in debugging python
code running in rhythmbox using the pydev python IDE for eclipse
( I haven't looked into it much, but it appears to
have its own remote debugging modules, so we could probably add some
code to the python console plugin (alongside the existing rpdb2 code)
to figure out where to find the pydev modules and start its debugging

I haven't seriously looked into any of these possibilities, they're
just things that I think would work, and for which I'd be happy to
accept patches.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]