示例#1
0
try:
    addon = Addon(addon_id, sys.argv)
except:
    addon = Addon(addon_id)

addon_path = addon.get_path()
addon_version = addon.get_version()

lib_path = os.path.join(addon_path, 'lib', 'entertainment')
plugins_path = os.path.join(lib_path, 'plugins')
settings_file = os.path.join(addon_path, 'resources', 'settings.xml')

profile_path = addon.get_profile()

theme_name = addon.get_setting('theme')
theme_type = addon.get_setting(theme_name+'_themetype')
if theme_type == 'online':
    icon_path = addon.get_setting(theme_name+'_themeurl')
else:
    theme_addon = Addon( addon.get_setting(theme_name+'_themeaddon') )
    icon_path = os.path.join(theme_addon.get_path(), 'theme')

def get_themed_icon(icon_file_name):
    if icon_path.startswith('http'):
        icon = icon_path + icon_file_name
    else:
        icon = os.path.join(icon_path, icon_file_name)
        #if not os.path.exists( icon ):
        #    icon = 'https://istream-xbmc-repo.googlecode.com/svn/images/' + icon_file_name
    return icon
示例#2
0
try:
    addon = Addon(addon_id, sys.argv)
except:
    addon = Addon(addon_id)

addon_path = addon.get_path()
addon_version = addon.get_version()

lib_path = os.path.join(addon_path, 'lib', 'entertainment')
plugins_path = os.path.join(lib_path, 'plugins')
settings_file = os.path.join(addon_path, 'resources', 'settings.xml')

profile_path = addon.get_profile()

theme_name = addon.get_setting('theme')
theme_type = addon.get_setting(theme_name + '_themetype')
if theme_type == 'online':
    icon_path = addon.get_setting(theme_name + '_themeurl')
else:
    theme_addon = Addon(addon.get_setting(theme_name + '_themeaddon'))
    icon_path = os.path.join(theme_addon.get_path(), 'theme')


def get_themed_icon(icon_file_name):
    if icon_path.startswith('http'):
        icon = icon_path + icon_file_name
    else:
        icon = os.path.join(icon_path, icon_file_name)
        #if not os.path.exists( icon ):
        #    icon = 'https://istream-xbmc-repo.googlecode.com/svn/images/' + icon_file_name