def modes(): if sys.argv[2] == '': _common.args.mode = module_name _common.args.sitemode = "rootlist" network = _common.get_network(_common.args.mode) all_description = '' count = 0 network_name = network.NAME station_icon = os.path.join(_common.IMAGEPATH, network.SITE + '.png') xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.root_list(_common.args.mode) xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Masterlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored = 1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': getattr(_common, _common.args.sitemode)() else: network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes(): if sys.argv[2] == '': all_description = '' networks = _common.get_networks() networks.sort(key = lambda x: x.SITE.replace('the', '')) for network in networks: if _addoncompat.get_setting(network.SITE) == 'true': if network.NAME.endswith(', The'): name = 'The ' +network.NAME.replace(', The', '') all_description += network.NAME + ', ' count = 0 _common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39000)), 'Favorlist', 'NoUrl', thumb = _common.FAVICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39001)) + '\n' + all_description) count += 1 _common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39002)), 'Masterlist', 'NoUrl', thumb = _common.ALLICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39003)) + '\n' + all_description) count += 1 for network in networks: network_name = network.NAME station_icon = os.path.join(_common.IMAGEPATH, network.SITE + '.png') if network_name.endswith(', The'): network_name = 'The ' + network_name.replace(', The', '') if _addoncompat.get_setting(network.SITE) == 'true': _common.add_directory(network_name, network.SITE, 'rootlist', thumb = station_icon, fanart = _common.PLUGINFANART, description = network.DESCRIPTION, count = count) count += 1 xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) _common.set_view() xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Masterlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.sitemode == 'rootlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.root_list(_common.args.mode) xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored = 1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': getattr(_common, _common.args.sitemode)() else: network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes( ): if sys.argv[2]=='': #Plug-in Root List allDescription = '' for network, name in sorted(common.site_dict.iteritems(), key=operator.itemgetter(1)): if common.addoncompat.get_setting(network) == 'true': if name.endswith(', The'): name = 'The '+name.replace(', The','') allDescription +=name+', ' count=0 common.addDirectory('Favorite Shows','Favorlist','NoUrl',thumb=common.fav_icon,count=count,description='Your Favorite Shows On:\n'+allDescription) count+=1 common.addDirectory('All Shows','Masterlist','NoUrl',thumb=common.all_icon,count=count,description='All Shows Available On:\n'+allDescription) count+=1 #for network, name in common.site_dict.iteritems(): for network, name in sorted(common.site_dict.iteritems(), key=operator.itemgetter(1)): station_icon = os.path.join(common.imagepath,network+'.png') if name.endswith(', The'): name = 'The '+name.replace(', The','') if common.addoncompat.get_setting(network) == 'true': common.addDirectory(name, network, 'rootlist',thumb=station_icon,fanart=common.plugin_fanart,description=common.site_descriptions[network],count=count) count+=1 xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) common.setView() xbmcplugin.endOfDirectory( pluginhandle ) elif common.args.mode == 'Masterlist': xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL) common.load_showlist() common.setView('tvshows') xbmcplugin.endOfDirectory(pluginhandle) elif common.args.mode == 'Favorlist': xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL) common.load_showlist(favored=True) common.setView('tvshows') xbmcplugin.endOfDirectory(pluginhandle) elif common.args.mode == 'common': exec 'common.%s()' % common.args.sitemode elif common.args.mode in common.site_dict.keys(): exec 'import resources.lib.%s as sitemodule' % common.args.mode exec 'sitemodule.%s()' % common.args.sitemode if not common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory( pluginhandle )
def modes(): if sys.argv[2] == '': _common.args.mode = module_name _common.args.sitemode = "rootlist" network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle) if _common.args.mode == 'Masterlist': print '\n\n\n start of Masterlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': print '\n\n\n start of Favorlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored=1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': print '\n\n\n start of contextmenu' getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': print '\n\n\n start of common' getattr(_common, _common.args.sitemode)() else: print '\n\n\n start of else : ' + _common.args.mode + ":" + _common.args.sitemode mode = _common.args.mode if hasattr(_common.args, 'mode') else "comedy" sitemode = _common.args.sitemode if hasattr(_common.args, 'sitemode') else "rootlist" network = _common.get_network(mode) if network: getattr(network, sitemode)() if not sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes(): if sys.argv[2] == '': _common.args.mode = module_name _common.args.sitemode = "rootlist" network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle) if _common.args.mode == 'Masterlist': print '\n\n\n start of Masterlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': print '\n\n\n start of Favorlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored = 1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': print '\n\n\n start of contextmenu' getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': print '\n\n\n start of common' getattr(_common, _common.args.sitemode)() else: print '\n\n\n start of else : ' + _common.args.mode + ":" + _common.args.sitemode mode = _common.args.mode if hasattr(_common.args, 'mode') else "comedy" sitemode = _common.args.sitemode if hasattr(_common.args, 'sitemode') else "rootlist" network = _common.get_network(mode) if network: getattr(network, sitemode)() if not sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes(): if sys.argv[2] == '': #Plug-in Root List allDescription = '' for network, name in sorted(common.site_dict.iteritems(), key=operator.itemgetter(1)): if common.addoncompat.get_setting(network) == 'true': if name.endswith(', The'): name = 'The ' + name.replace(', The', '') allDescription += name + ', ' count = 0 common.addDirectory('Favorite Shows', 'Favorlist', 'NoUrl', thumb=common.fav_icon, count=count, description='Your Favorite Shows On:\n' + allDescription) count += 1 common.addDirectory('All Shows', 'Masterlist', 'NoUrl', thumb=common.all_icon, count=count, description='All Shows Available On:\n' + allDescription) count += 1 #for network, name in common.site_dict.iteritems(): for network, name in sorted(common.site_dict.iteritems(), key=operator.itemgetter(1)): station_icon = os.path.join(common.imagepath, network + '.png') if name.endswith(', The'): name = 'The ' + name.replace(', The', '') if common.addoncompat.get_setting(network) == 'true': common.addDirectory( name, network, 'rootlist', thumb=station_icon, fanart=common.plugin_fanart, description=common.site_descriptions[network], count=count) count += 1 xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) common.setView() xbmcplugin.endOfDirectory(pluginhandle) elif common.args.mode == 'Masterlist': xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL) common.load_showlist() common.setView('tvshows') xbmcplugin.endOfDirectory(pluginhandle) elif common.args.mode == 'Favorlist': xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL) common.load_showlist(favored=True) common.setView('tvshows') xbmcplugin.endOfDirectory(pluginhandle) elif common.args.mode == 'common': exec 'common.%s()' % common.args.sitemode elif common.args.mode in common.site_dict.keys(): exec 'import resources.lib.%s as sitemodule' % common.args.mode exec 'sitemodule.%s()' % common.args.sitemode if not common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginhandle)
def modes(): if sys.argv[2] == '': all_description = '' for network, name in sorted(_common.site_dict.iteritems(), key=operator.itemgetter(1)): if _addoncompat.get_setting(network) == 'true': if name.endswith(', The'): name = 'The ' + name.replace(', The', '') all_description += name + ', ' count = 0 _common.add_directory( xbmcaddon.Addon(id=_common.ADDONID).getLocalizedString(39000), 'Favorlist', 'NoUrl', thumb=_common.FAVICON, count=count, description=xbmcaddon.Addon( id=_common.ADDONID).getLocalizedString(39001) + '\n' + all_description) count += 1 _common.add_directory( xbmcaddon.Addon(id=_common.ADDONID).getLocalizedString(39002), 'Masterlist', 'NoUrl', thumb=_common.ALLICON, count=count, description=xbmcaddon.Addon( id=_common.ADDONID).getLocalizedString(39003) + '\n' + all_description) count += 1 for network, name in sorted(_common.site_dict.iteritems(), key=operator.itemgetter(1)): station_icon = os.path.join(_common.IMAGEPATH, network + '.png') if name.endswith(', The'): name = 'The ' + name.replace(', The', '') if _addoncompat.get_setting(network) == 'true': _common.add_directory( name, network, 'rootlist', thumb=station_icon, fanart=_common.PLUGINFANART, description=_common.site_descriptions[network], count=count) count += 1 xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) _common.set_view() xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Masterlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored=1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': exec '_contextmenu.%s()' % _common.args.sitemode elif _common.args.mode == '_common': exec '_common.%s()' % _common.args.sitemode elif _common.args.mode in _common.site_dict.keys(): exec 'import resources.lib.%s as sitemodule' % _common.args.mode exec 'sitemodule.%s()' % _common.args.sitemode if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes(): if sys.argv[2] == '': _common.args.mode = module_name _common.args.sitemode = "rootlist" network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle) #all_description = '' #network = _common.get_network(module_name) #count = 1 #networks = _common.get_networks() #networks.sort(key = lambda x: x.SITE) #for network in networks: # if _addoncompat.get_setting(network.SITE) == 'true': # if network.NAME.endswith(', The'): # name = 'The ' +network.NAME.replace(', The', '') # all_description += network.NAME + ', ' #count = 0 #_common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39000)), 'Favorlist', 'NoUrl', thumb = _common.FAVICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39001)) + '\n' + all_description) #count += 1 #_common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39002)), 'Masterlist', 'NoUrl', thumb = _common.ALLICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39003)) + '\n' + all_description) #count += 1 #for network in networks: #network_name = network.NAME #station_icon = os.path.join(_common.IMAGEPATH, network.SITE + '.png') #if network_name.endswith(', The'): # network_name = 'The ' + network_name.replace(', The', '') #if _addoncompat.get_setting(network.SITE) == 'true': # _common.add_directory(network_name, network.SITE, 'rootlist', thumb = station_icon, fanart = _common.PLUGINFANART, description = network.DESCRIPTION, count = count) # count += 1 #xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) #_common.set_view() #xbmcplugin.endOfDirectory(pluginHandle) if _common.args.mode == 'Masterlist': print '\n\n\n start of Masterlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': print '\n\n\n start of Favorlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored=1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': print '\n\n\n start of contextmenu' getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': print '\n\n\n start of common' getattr(_common, _common.args.sitemode)() else: print '\n\n\n start of else : ' + _common.args.mode + ":" + _common.args.sitemode mode = _common.args.mode if hasattr(_common.args, 'mode') else "comedy" sitemode = _common.args.sitemode if hasattr(_common.args, 'sitemode') else "rootlist" network = _common.get_network(mode) if network: getattr(network, sitemode)() if not sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)
def modes(): if sys.argv[2] == '': _common.args.mode = module_name _common.args.sitemode = "rootlist" network = _common.get_network(_common.args.mode) if network: getattr(network, _common.args.sitemode)() if not _common.args.sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle) #all_description = '' #network = _common.get_network(module_name) #count = 1 #networks = _common.get_networks() #networks.sort(key = lambda x: x.SITE) #for network in networks: # if _addoncompat.get_setting(network.SITE) == 'true': # if network.NAME.endswith(', The'): # name = 'The ' +network.NAME.replace(', The', '') # all_description += network.NAME + ', ' #count = 0 #_common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39000)), 'Favorlist', 'NoUrl', thumb = _common.FAVICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39001)) + '\n' + all_description) #count += 1 #_common.add_directory(_common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39002)), 'Masterlist', 'NoUrl', thumb = _common.ALLICON, count = count, description = _common.smart_utf8(xbmcaddon.Addon(id = _common.ADDONID).getLocalizedString(39003)) + '\n' + all_description) #count += 1 #for network in networks: #network_name = network.NAME #station_icon = os.path.join(_common.IMAGEPATH, network.SITE + '.png') #if network_name.endswith(', The'): # network_name = 'The ' + network_name.replace(', The', '') #if _addoncompat.get_setting(network.SITE) == 'true': # _common.add_directory(network_name, network.SITE, 'rootlist', thumb = station_icon, fanart = _common.PLUGINFANART, description = network.DESCRIPTION, count = count) # count += 1 #xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_PLAYLIST_ORDER) #_common.set_view() #xbmcplugin.endOfDirectory(pluginHandle) if _common.args.mode == 'Masterlist': print '\n\n\n start of Masterlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist() _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == 'Favorlist': print '\n\n\n start of Favorlist' xbmcplugin.addSortMethod(pluginHandle, xbmcplugin.SORT_METHOD_LABEL) _common.load_showlist(favored = 1) _common.set_view('tvshows') xbmcplugin.endOfDirectory(pluginHandle) elif _common.args.mode == '_contextmenu': print '\n\n\n start of contextmenu' getattr(_contextmenu, _common.args.sitemode)() elif _common.args.mode == '_common': print '\n\n\n start of common' getattr(_common, _common.args.sitemode)() else: print '\n\n\n start of else : ' + _common.args.mode + ":" + _common.args.sitemode mode = _common.args.mode if hasattr(_common.args, 'mode') else "comedy" sitemode = _common.args.sitemode if hasattr(_common.args, 'sitemode') else "rootlist" network = _common.get_network(mode) if network: getattr(network, sitemode)() if not sitemode.startswith('play'): xbmcplugin.endOfDirectory(pluginHandle)