Re: Grilo addon for Kodi



I had trouble getting the gi module to import from the context of
the
Kodi process, so I separated the Grilo functionality into a
daemon
process (grilohttpd) which bridges HTTP and Grilo sources. Kodi
addons are stateless, so grilohttpd has the nice side effect of
providing a persistent cache of the things available through a
Grilo
source. I would be interested to hear any theories on why gi
might
have been malfunctioning in my earlier attempt.
 
What errors did you get trying to import and then use gi in Kodi?

From what I could tell, the "import gi" statement would never
complete. The Kodi process would continue to respond to input (e.g.,
I could "esc" out of the plugin), however the plugin itself would
continuously display its progress spinner.
 
Any chance you could get a backtrace from that? Any other errors in the
journal or in the application's output?

Here is a simplified addon:

import gi

xbmc.log('1', level=xbmc.LOGERROR)

gi.require_version('Soup', '2.4')
xbmc.log('2', level=xbmc.LOGERROR)

gi.require_version('GLib', '2.0')
xbmc.log('3', level=xbmc.LOGERROR)

gi.require_version('Grl',  '0.3')
xbmc.log('4', level=xbmc.LOGERROR)

from gi.repository import Soup
xbmc.log('5', level=xbmc.LOGERROR)

from gi.repository import GLib
xbmc.log('6', level=xbmc.LOGERROR)

from gi.repository import Grl
xbmc.log('7', level=xbmc.LOGERROR)

And the Kodi log which results from clicking on the addon,
exiting, and clicking on it again follows. Notice Kodi prints '1'--'7'
on the first run, but the second stops at '4'. Does gi rely on a full
exit to release its resources?

21:59:18.447 T:140706892663296  NOTICE: initialize done
21:59:18.447 T:140706892663296  NOTICE: Running the application...
21:59:18.449 T:140706892663296  NOTICE: starting zeroconf publishing
21:59:18.449 T:140706892663296  NOTICE: starting upnp client
21:59:18.450 T:140704781158144  NOTICE: ES: Starting UDP Event server on port 9777
21:59:18.450 T:140704781158144  NOTICE: UDP: Listening on port 9777 (ipv6 : false)
21:59:21.866 T:140706340919040   ERROR: GetDirectory - Error getting
21:59:21.909 T:140704759109376   ERROR: Previous line repeats 3 times.
21:59:21.909 T:140704759109376   ERROR: 1
21:59:21.909 T:140704759109376   ERROR: 2
21:59:21.910 T:140704759109376   ERROR: 3
21:59:21.910 T:140704759109376   ERROR: 4
21:59:21.926 T:140704759109376   ERROR: 5
21:59:21.926 T:140704759109376   ERROR: 6
21:59:21.926 T:140704759109376   ERROR: 7
21:59:21.935 T:140706892663296   ERROR: GetDirectory - Error getting plugin://plugin.audio.grilo/
21:59:21.935 T:140706892663296   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.grilo/) failed
21:59:39.331 T:140706892663296   ERROR: Control 55 in window 10502 has been asked to focus, but it can't
21:59:39.363 T:140705272092416   ERROR: 1
21:59:39.363 T:140705272092416   ERROR: 2
21:59:39.363 T:140705272092416   ERROR: 3
21:59:39.363 T:140705272092416   ERROR: 4
21:59:39.372 T:140705272092416   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script 
returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: Error when calling the metaclass bases
                                                'NoneType' object is not callable
                                            Traceback (most recent call last):
                                              File "/home/mike/.kodi/addons/plugin.audio.grilo/addon.py", 
line 17, in <module>
                                                from gi.repository import Soup
                                              File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 
145, in load_module
                                                importlib.import_module('gi.repository.' + dep.split("-")[0])
                                              File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in 
import_module
                                                __import__(name)
                                              File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 
145, in load_module
                                                importlib.import_module('gi.repository.' + dep.split("-")[0])
                                              File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in 
import_module
                                                __import__(name)
                                              File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 
145, in load_module
                                                importlib.import_module('gi.repository.' + dep.split("-")[0])
                                              File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in 
import_module
                                                __import__(name)
                                              File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 
146, in load_module
                                                dynamic_module = load_overrides(introspection_module)
                                              File 
"/usr/lib64/python2.7/site-packages/gi/overrides/__init__.py", line 125, in load_overrides
                                                override_mod = importlib.import_module(override_package_name)
                                              File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in 
import_module
                                                __import__(name)
                                              File "/usr/lib64/python2.7/site-packages/gi/overrides/GLib.py", 
line 228, in <module>
                                                class Variant(GLib.Variant):
                                              File "/usr/lib64/python2.7/site-packages/gi/types.py", line 
324, in __init__
                                                super(StructMeta, cls).__init__(name, bases, dict_)
                                            TypeError: Error when calling the metaclass bases
                                                'NoneType' object is not callable
                                            -->End of Python script error report<--
21:59:39.388 T:140706892663296   ERROR: GetDirectory - Error getting plugin://plugin.audio.grilo/
21:59:39.388 T:140706892663296   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.grilo/) failed

-- 
Mike

:wq


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