Exemplo n.º 1
0
	def username():
		rtype = 'api'
		response = github.find_zips(q)
		if response is None: return
		for r in github.sort_results(response['items']):
			url = github.content_url % (r['repository']['full_name'], r['path'])
			menu = kodi.ContextMenu()
			if r['is_repository']:
				menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])})
			if r['is_feed']:
				r['display'] = "[COLOR yellow]%s[/COLOR]" % r['name']
				kodi.add_menu_item({'mode': 'install_feed', "url": url}, {'title': r['name'], 'display': r['display']}, menu=menu, icon='null')
			else:
				kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null')
Exemplo n.º 2
0
	def repository():
		rtype = 'api'
		results = github.search(q, 'title')
		if results is None: return
		for i in results['items']:
			user = i['owner']['login']
			response = github.find_zips(user)
			if response is None: continue
			for r in github.sort_results(response['items']):
				url = github.content_url % (r['repository']['full_name'], r['path'])
				menu = kodi.ContextMenu()
				if r['is_repository']:
					menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])})
				if r['is_feed']:
					kodi.add_menu_item({'mode': 'install_feed', "url": url}, {'title': r['name']}, menu=menu, icon='null')
				else:
					kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null')
Exemplo n.º 3
0
	def username():
		rtype = 'api'
		response = github.find_zips(q)
		if response is None: return
		for r in github.sort_results(response['items']):
			url = get_download_url(r['repository']['full_name'], r['path'])
			menu = kodi.ContextMenu()
			if r['is_repository']:
				menu.add('Browse Repository Contents', {"mode": "browse_repository", "url": url, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])})
			if r['is_feed']:
				r['display'] = "[COLOR yellow]%s[/COLOR]" % r['name']
				kodi.add_menu_item({'mode': 'install_feed', "url": url}, {'title': r['name'], 'display': r['display']}, menu=menu, icon='null')
			elif r['is_installer']:
				r['display'] = "[COLOR orange]%s[/COLOR]" % r['name']
				kodi.add_menu_item({'mode': 'install_batch', "url": url}, {'title': r['name'], 'display': r['display']}, menu=menu, icon='null')	
			else:
				kodi.add_menu_item({'mode': 'github_install', "url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}, {'title': r['name']}, menu=menu, icon='null')