Skip to content

Instantly share code, notes, and snippets.

@aji aji/repro.py Secret
Created Aug 23, 2015

Embed
What would you like to do?
script to reproduce weechat github issue #406
import weechat
COUNTER = 0
def decrease_counter(*args, **kwargs):
global COUNTER
if COUNTER > 0:
COUNTER -= 1
if COUNTER == 0:
weechat.prnt('', 'All processes finished')
return weechat.WEECHAT_RC_OK
def issue406(*args, **kwargs):
global COUNTER
COUNTER += 1
weechat.hook_process('false', 0, 'decrease_counter', '')
return weechat.WEECHAT_RC_OK
def issue406url(*args, **kwargs):
global COUNTER
COUNTER += 1
weechat.hook_process('url:http://127.0.0.1:34567', 0, 'decrease_counter', '')
return weechat.WEECHAT_RC_OK
weechat.register('repro', 'aji', '1.0', 'MIT', 'github issue #406', '', '')
weechat.hook_command('issue406', 'github issue #406', '', '', '', 'issue406', '')
weechat.hook_command('issue406url', 'github issue #406 url',
'', '', '', 'issue406url', '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.