Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: unable to remove a bind #1560

Open
crazycatdevs opened this issue Apr 9, 2024 · 2 comments
Open

python: unable to remove a bind #1560

crazycatdevs opened this issue Apr 9, 2024 · 2 comments

Comments

@crazycatdevs
Copy link
Contributor

Hi,
testing the feature/python branch, I notice it's quite difficult to remove a python bind.

Test script:

from eggdrop import *

def tb(nick, uhost, handle, chan, text, **kwargs):
    tcl.putmsg(chan, 'ok, try unbinding')
    try:
        unbind('pub', '*', '!tb', tb)
    except:
        tcl.putmsg(chan, "1. unbind didn't work")
        try:
            tcl.unbind('pub', '*', '!tb', tb)
        except:
            tcl.putmsg(chan, "2. tcl.unbind didn't work")

bind('pub', '*', '!tb', tb)

Script loaded:

#CrazyCat# binds python
Command bindings:
      TYPE FLAGS    COMMAND              HITS BINDING (TCL)
       pub -|-      !tb                     0 *python:pub:!tb:74a92668

In channel:

<CrazyCat> !tb
<pyegg> ok, try unbinding
<pyegg> 1. unbind didn't work
<pyegg> 2. tcl.unbind didn't work

And the only way to delete it is .tcl unbind pub * !tb *python:pub:!tb:74a92668

@vanosg
Copy link
Member

vanosg commented Apr 9, 2024

in short- @thommey we need a python unbind command

@michaelortmann
Copy link
Member

maybe it would be enough to change function tcl_bind() in tclhash.c so it works similar to function tell_binds() in tclhash.c? so that .tcl unbind python * [...] would work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants