Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

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

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

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

Post 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
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

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

Post 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
XBMC2 plugin to control XBMC. If you want to flatter me Image
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

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

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

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

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

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

Post by krambriw »

Dear Pako,

I worked perfect, thanks a lot !!!

My very best regards, Walter
Post Reply