RuntimeError Using xbmc.Monitor - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: RuntimeError Using xbmc.Monitor (/showthread.php?tid=197974) |
RuntimeError Using xbmc.Monitor - SultanMA - 2014-06-16 Hi all, I'm developing a script to keep listening if the database updated. I found that xbmc.Monitor has a method onDatabaseUpdated Here is my code: Quote:import xbmc And here is the xbmc logs error: Quote:02:57:07 T:6108 ERROR: EXCEPTION: access_voilation Any help please? RE: RuntimeError Using xbmc.Monitor - leechguy - 2014-06-16 Try: Code: import xbmc RE: RuntimeError Using xbmc.Monitor - SultanMA - 2014-06-17 I tried it. the same error Here is the log: Quote:10:18:26 T:10884 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- RE: RuntimeError Using xbmc.Monitor - leechguy - 2014-06-17 First of all make sure that when indenting the code, you use either spaces or tabs. Don't mix them because that can lead to funny errors. I use 4 spaces myself. Change Code: def onDatabaseUpdated( self ): to Code: def onDatabaseUpdated( self, database ): If that does not work try the following addon (this works for me). Create a service.dbupdate directory in your addon directory and add the following files: addon.xml: Code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> service.py: Code: import os After starting XBMC and updating the library: Quote:~/.xbmc/temp$ tail -F xbmc.log |grep service.dbupdate RE: RuntimeError Using xbmc.Monitor - SultanMA - 2014-06-18 It worked leechguy :-) Thank you so much, I think the problem is that I was trying to access xbmc.Monitor via scripts. I didn't defined my script as addon. Thank you again guys for the awesome help. RE: RuntimeError Using xbmc.Monitor - leechguy - 2014-06-18 Cool Good luck with your add-on! RE: RuntimeError Using xbmc.Monitor - pci5233 - 2016-12-04 Hi, I've tried the service.dbupdate example as i have a problem with xbmc.Monitor in Jarvis (Debian (16.1 Debian package version: 16.1+dfsg1-2). Platform: Linux x86 64-bit) When you enable/disable the service the whole kodi interface get stuck. Any idea of an other way to kill the xbmc.Monitor thread ? pci. Finally i found it. I've got another service that "attach" an xbmcaddon.Addon() object in the xbmc.Monitor child class. If think it create a lock. I think when i tried to enable/disable the service.dbupdate my kodi instance was in bad condition due to the other service doing weird things. An example of thing to avoid: class AnotherMonitor(xbmc.Monitor): def __init__(self): self.myaddon=xbmcaddon.Addon() <-- This is a really bad idea RE: RuntimeError Using xbmc.Monitor - ronie - 2016-12-04 the xbmc.abortRequested method in info above is outdated, stay away from it :-) up-to-date info can be found in the wiki: http://kodi.wiki/view/Service_addons |