def completion_cb(data, completion_item, buf, completion): """Completion callback.""" check(data == 'completion_data') check(completion_item == 'SCRIPT_NAME') check(weechat.hook_completion_get_string(completion, 'args') == 'w') weechat.hook_completion_list_add(completion, 'word_completed', 0, weechat.WEECHAT_LIST_POS_END) return weechat.WEECHAT_RC_OK
def at_complete(data,item,buffer,completion): weechat.prnt('','at_complete: %s %s' % (item, weechat.buffer_get_string(buffer,'name'))) args = weechat.hook_completion_get_string(completion,'args') weechat.prnt('','at_complete: a: %s' % args) return weechat.WEECHAT_RC_OK
# # Author: Sébastien Helleu <*****@*****.**> # """A WeeChat script.""" import weechat if __name__ == '__main__': if weechat.register('script', 'author', '0.1', 'GPL3', 'desc', '', ''): weechat.hook_completion_get_string('0x123abc', 'base_command')