def _run(plugin, endpoint, **items): '''Returns a RunPlugin string for use in a context menu. :param endpoint: The endpoint to be used with playlists.url_for(). :param **items: Any keyword args to be passed to playlists.url_for(). ''' return actions.background(plugin.url_for(endpoint, **items))
def ClearPlaylists(item=""): if item == "": label = '[COLOR yellow]Xóa hết Playlists[/COLOR]' else: label = '[COLOR yellow]Xóa "%s"[/COLOR]' % item return (label, actions.background("%s/remove-playlists/%s" % (pluginrootpath, urllib.quote_plus(item))))
def ClearPlaylists(item=""): if item == "": label = '[COLOR yellow]Xóa hết Playlists[/COLOR]' else: label = '[COLOR yellow]Xóa "%s"[/COLOR]' % item return (label, actions.background( "%s/remove-playlists/%s" % (pluginrootpath, urllib.quote_plus(item)) ))
def test_background(self): expected = 'RunPlugin(plugin://plugin.video.hellokodi/script.py)' actual = background('plugin://plugin.video.hellokodi/script.py') self.assertEqual(actual, expected)