Linux The event handler plug-ins e.g. onStart onShutdown
#1
Hi,
Sorry for my bad english

As the topic, there is any event handler which can informing me about status add-ons? I'm mean which add-on is running and which is not..

Regards
Reply
#2
Any ideas?
Reply
#3
list of running addons:
Code:
running = xbmcvfs.listdir('addons://running/')[1]

list all installed addons:
Code:
installed = xbmcvfs.listdir('addons://user/all/')[1]

diff between those two will get you a list of addons that are not running:
Code:
notrunning = list(set(installed) - set(running))
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
Sweet, an undocumented function. At least it isn't in PyDocs.

Does it remain true that the only way to update PyDocs is via editing the source code?
Reply
#5
Thank you very much Ronie, this is what i need, but why my own addons is not available in running list? e.g. In previous window i'm using <onload>RunAddon(myaddon)</onload> and in the next window i'm running script (myaddonslist) to display list of running and installed addons, then we have:
Code:
('running', ['service.xbmc.versioncheck', 'service.skin.widgets'])
('installed', ['service.xbmc.versioncheck', 'service.skin.widgets', 'myskin', 'skin.confluence', 'myaddon', 'myaddonslist'])
So why 'myskin', 'myaddon' and even 'myaddonlist' is not in running list? it depends on some extension points or something? or maybe my addons is not complete?
Reply
#6
(2016-01-13, 12:21)Kasjer Wrote: Thank you very much Ronie, this is what i need, but why my own addons is not available in running list? e.g. In previous window i'm using <onload>RunAddon(myaddon)</onload> and in the next window i'm running script (myaddonslist) to display list of running and installed addons, then we have:
Code:
('running', ['service.xbmc.versioncheck', 'service.skin.widgets'])
('installed', ['service.xbmc.versioncheck', 'service.skin.widgets', 'myskin', 'skin.confluence', 'myaddon', 'myaddonslist'])
So why 'myskin', 'myaddon' and even 'myaddonlist' is not in running list? it depends on some extension points or something? or maybe my addons is not complete?

Yes, in some ways it depends on if your addon is a service and remains running after you call it. The skin doesn't actually run code.
In my testing, the above code does NOT detect plugin runs. At first I thought it might be because they run and exit so quickly that even a fast loop misses them.
However, even preventing a plugin from exiting by putting a long xbmc.sleep prior to exit in the plugin fails to have it show up in the 'running' variable above, at least in my testing.

Post your code including your addon.xml to github and post a link back here.
Reply
#7
Hi KenV99.
There must by something else. I changed extension points and list of running addons is always the same, even copied content from visible addon (except "id") from addon.xml not helped.

My files addon.xml is truncated templates, so there is almost nothing.
e.g addon which is running at time using RunAddon(myaddonslist):
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="myaddon" name="My Addon" version="1.0.0" provider-name="kasjer">

  <extension point="xbmc.python.script" library="addon.py">
    <provides>executable</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
  </extension>
</addon>
Maybe is some python code to fill addons://running/ module.
translatePath(...) not working this.
Reply
#8
(2016-01-14, 12:07)Kasjer Wrote: Hi KenV99.
There must by something else. I changed extension points and list of running addons is always the same, even copied content from visible addon (except "id") from addon.xml not helped.

My files addon.xml is truncated templates, so there is almost nothing.
e.g addon which is running at time using RunAddon(myaddonslist):
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="myaddon" name="My Addon" version="1.0.0" provider-name="kasjer">

  <extension point="xbmc.python.script" library="addon.py">
    <provides>executable</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
  </extension>
</addon>
Maybe is some python code to fill addons://running/ module.
translatePath(...) not working this.

What is in addon.py? Does your code run and exit or is there code to keep it running like a standard abort loop?
For example:
Code:
import xbmc

def dosomething():
    pass

if __name__ == '__main__':
    monitor = xbmc.Monitor()
    dosomething()
    monitor.waitForAbort()  # Like this

And if you want it to run at startup you need your extension point to look like:
Code:
<extension point="xbmc.service" library="default.py" start="startup">
Reply
#9
It's workingSmile
(2016-01-14, 14:17)KenV99 Wrote: And if you want it to run at startup you need your extension point to look like:
Code:
<extension point="xbmc.service" library="default.py" start="startup">

You were right to extension point "xbmc.service". I do not know why it did not work to me for the first timeSmile
Is there a list with extension points which be visible for addons://running/ module?
Reply
#10
(2016-01-14, 15:22)Kasjer Wrote: It's workingSmile
(2016-01-14, 14:17)KenV99 Wrote: And if you want it to run at startup you need your extension point to look like:
Code:
<extension point="xbmc.service" library="default.py" start="startup">

You were right to extension point "xbmc.service". I do not know why it did not work to me for the first timeSmile
Is there a list with extension points which be visible for addons://running/ module?

Not that I'm aware of. As I mentioned above, using xbmcvfs in that matter seems to be wholly undocumented.
Reply
#11
OK, now I should handle with this further.

Thank a lot for help
Reply
#12
One more question to this case:

(2016-01-12, 12:55)ronie Wrote: list of running addons:
Code:
running = xbmcvfs.listdir('addons://running/')[1]

list all installed addons:
Code:
installed = xbmcvfs.listdir('addons://user/all/')[1]

diff between those two will get you a list of addons that are not running:
Code:
notrunning = list(set(installed) - set(running))

On Debian 8.3 jessie and kodi v14.2, i've got an error:
Code:
GetDirectory - Error getting addons://user/all/
Is it mean that kodiv14.2 have no special-path addon://user/all?
Reply
#13
I can't find any solution. How i may get list of installed addons in kodi v14.2? it turned out that addon has also running on older versions. Please help.
Reply

Logout Mark Read Team Forum Stats Members Help
The event handler plug-ins e.g. onStart onShutdown1