2018-03-19, 20:22
Hi guys,
Here again, i successfuly built a module with Cython, thanks to the help recived here, now i have another weird problem, (at lest for me!):
I isolated the problem, so just few lines are enough to reproduce the crash.
Hello.pyx
plugin.py
On first run, everything is ok, log shows my cwd and Test1, if i choose somenthing from the index list, kodi crashes.
If i will remove imports from hello.pyx evertyng works as espected, but i would like to import something...
AS always remember, i'm a noob and if you need more information just ask! Thanks
Here again, i successfuly built a module with Cython, thanks to the help recived here, now i have another weird problem, (at lest for me!):
I isolated the problem, so just few lines are enough to reproduce the crash.
Hello.pyx
python:import xbmc, os
def say_hello_to(name):
xbmc.log(os.getcwd())
return "Hello %s!" % name
plugin.py
python:
# -*- coding: utf-8 -*-
import routing
import logging
import xbmcaddon
import os
from resources.lib import kodiutils
from resources.lib import kodilogging
from xbmcgui import ListItem
from xbmcplugin import addDirectoryItem, endOfDirectory
from resources.lib.hello import say_hello_to
ADDON = xbmcaddon.Addon()
logger = logging.getLogger(ADDON.getAddonInfo('id'))
kodilogging.config()
plugin = routing.Plugin()
@plugin.route('/')
def index():
cat = say_hello_to("Test1")
xbmc.log(cat)
addDirectoryItem(plugin.handle, plugin.url_for(
show_category, "one"), ListItem(cat), True)
addDirectoryItem(plugin.handle, plugin.url_for(
show_category, "two"), ListItem("Category Two"), True)
endOfDirectory(plugin.handle)
@plugin.route('/category/<category_id>')
def show_category(category_id):
cat2 = say_hello_to("Test2")
addDirectoryItem(
plugin.handle, "", ListItem("Hello category %s!" % cat2))
endOfDirectory(plugin.handle)
def run():
plugin.run()
On first run, everything is ok, log shows my cwd and Test1, if i choose somenthing from the index list, kodi crashes.
If i will remove imports from hello.pyx evertyng works as espected, but i would like to import something...
AS always remember, i'm a noob and if you need more information just ask! Thanks