2013-12-18, 22:34
I see a lot of this kind of thing:
Is there any way to avoid this kind of butchery? (other than "from resources.lib import ...") Is there something that can be added to addon.xml that defines a folder to be added to sys.path? I can't find anything but thought I'd ask.
Code:
import xbmcaddon
__addon__ = xbmcaddon.Addon()
__addonpath__ = __addon__.getAddonInfo('path')
__resource__ = os.path.join( __addonpath__, 'resources', 'lib' )
sys.path.append(__resource__)
Is there any way to avoid this kind of butchery? (other than "from resources.lib import ...") Is there something that can be added to addon.xml that defines a folder to be added to sys.path? I can't find anything but thought I'd ask.