Page 1 of 1

How to get a list of registered plugins/actions/macros

Posted: Tue Feb 21, 2012 1:51 pm
by krambriw
Is there a nice way to get a list of registered plugins with its actions, to get a list defined macros, using some python statements?

Elements that you normally see in your configuration tree.

Bets regards, Walter

Re: How to get a list of registered plugins/actions/macros

Posted: Tue Feb 21, 2012 5:16 pm
by jonib
This seems to list added plugins:

Code: Select all

eg.plugins.__dict__.keys()
This shows all actions from my XBMC2 plugin (the name might be different on other configs):

Code: Select all

eg.plugins.XBMC.__dict__["actions"].keys()
Example Python script code that prints all plugin and XBMC2 actions to the log (useless):

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1544">
    <Action>
        EventGhost.PythonScript(u'print "Plugins:"\nfor Plugin in eg.plugins.__dict__.keys():\n    print Plugin\nprint "Actions for XBMC:"\nfor Actions in eg.plugins.XBMC.__dict__["actions"].keys():\n    print Actions\n\n')
    </Action>
</EventGhost>
Hope this is useful, I used the Python shell in the help menu to find the info.

jonib

Re: How to get a list of registered plugins/actions/macros

Posted: Fri Feb 24, 2012 10:19 am
by krambriw
Thanks Jonib, it works. I am able to find all installed plugins and their actions.

Do you happen to know where in eg name space I can find all defined macros? I have been trying to look there but there are no find functions in the python shell....

Best regards, Walter

Re: How to get a list of registered plugins/actions/macros

Posted: Fri Feb 24, 2012 11:20 am
by Pako
Dear Walter!
krambriw wrote:Is there a nice way to get a list of registered plugins with its actions ...
You can see how it's done in the plugin Websocket Suite.
krambriw wrote:... to get a list defined macros, using some python statements?
You have to recursively search through this list: eg.document.__dict__['root'].childs

Pako

Re: How to get a list of registered plugins/actions/macros

Posted: Fri Feb 24, 2012 12:49 pm
by krambriw
Dear Pako,

I worked perfect, thanks a lot !!!

My very best regards, Walter