コード例 #1
0
def reddit_save(action, thing_id):

    url = reddit_url('/api/{0}'.format(action))

    post_data = {'id': thing_id}

    response = client.request(url,
                              post=post_data,
                              output='extended',
                              headers=request_headers())

    if control.setting('debugging.toggle') == 'true':
        log_debug(response)

    if action == 'unsave':
        refresh()
コード例 #2
0
from resources.lib import action, url, query

if action is None:
    from resources.lib.indexers import navigator
    navigator.root()

elif action == 'play':
    from resources.lib.modules import player
    player.play(url)

elif action == 'add':
    from resources.lib.modules import tools
    tools.add_to_history()

elif action == 'readme':
    from resources.lib.modules import tools
    tools.readme()

elif action == 'refresh':
    from resources.lib.modules import tools
    tools.refresh()

elif action == 'clear_history':
    from resources.lib.modules import tools
    tools.clear_history()

elif action == 'delete_from_history':
    from resources.lib.modules import tools
    tools.delete_from_history(query)
コード例 #3
0
    get_tokens(refresh=True)

elif action == 'ip_address_set':

    from resources.lib.modules.reddit import ip_address_set
    ip_address_set()

elif action == 'clear_cache':

    from tulip import cache
    cache.clear(withyes=False)

elif action == 'debugging_toggle':

    from resources.lib.modules.tools import debugging_toggle
    debugging_toggle()

elif action == 'refresh':

    from resources.lib.modules.tools import refresh
    refresh()

elif action == 'quit':

    from tulip.control import quit_kodi
    quit_kodi()


# TODO: Add ability to open /r/* links (needs testing)
# TODO: Add /domain/* navigation ability (needs testing)