Пример #1
0
		
		if isSettingsBad(username, password):
			return []
	
	try:	
		classes = loadClasses(username, password)
	except urllib2.HTTPError, ex:
		if ex.code != 401:
			raise ex
		else:
			plugin.notify(msg="Unable to login to Coursera")
			print "Unable to login to Coursera"
			return []
	
#	plugin.log.debug(classes)
	plugin.add_sort_method(xbmcswift2.SortMethod.TITLE_IGNORE_THE)

	items = []
	for c in classes:
		url = plugin.url_for('listCourses', shortName=c["short_name"])
		
		items.append({
			'label': c["name"],
			'path': url,
			'is_playable': False,
			'label2':c["short_description"],
			'icon':c['large_icon'],
			'thumbnail':c['large_icon'],
#			'context_menu':[("test", "XBMC.RunPlugin(%s)" % url)],
		})
	
Пример #2
0
        if isSettingsBad(username, password):
            return []

    try:
        classes = loadClasses(username, password)
    except urllib2.HTTPError, ex:
        if ex.code != 401:
            raise ex
        else:
            plugin.notify(msg="Unable to login to Coursera")
            print "Unable to login to Coursera"
            return []


#	plugin.log.debug(classes)
    plugin.add_sort_method(xbmcswift2.SortMethod.TITLE_IGNORE_THE)

    items = []
    for k, c in classes["topics"].iteritems():
        url = plugin.url_for('listCourses', shortName=c["short_name"])

        items.append({
            'label': c["name"],
            'path': url,
            'is_playable': False,
            'label2': c["short_description"],
            'icon': c['large_icon'],
            'thumbnail': c['large_icon'],
            #			'context_menu':[("test", "XBMC.RunPlugin(%s)" % url)],
        })