Open teto opened 5 years ago
Your log looks just as expected and it seems from the log that your hook actually got called. The log does not contain any errors, so what is your problem exactly?
One thing you might want to check is that your hooks-file (which does not have the default name!) actually gets interpreted on startup.
The hook file is loaded correctly (btw having a ui popup when it doesn't would be nice).
My problem is I would expect a prompt to show up and ask me for a path since I have ui.prompt
in my code. Right now nothing happens. I can keep typing in alot without any issue.
Also I forgot but I tried to test locally with master but it seems that the iscoroutine check always returns false https://github.com/pazz/alot/blob/1e346cac12fdce13a6fe1aec790ebb5ee1c5651e/alot/commands/globals.py#L408-L409 even if the command is "hooks.apply_patch(ui)" with apply_patch defined as:
async def apply_patch(ui):
fromaddress = yield ui.prompt('Git repository')
what I do is the same as in the attach_keys
contrib hooks on the wiki. Does that one work for you ?
Describe the bug I am trying to add a hook that prompts the user for a path but no prompt happens/nothing happens yet the binding is called (similar to https://github.com/pazz/alot/wiki/Contrib-Hooks#attach-gpg-keys)
Software Versions
To Reproduce Steps to reproduce the behaviour:
set hooksfile to point at https://github.com/teto/home/blob/master/config/alot/apply_patch.py
add a binding (dunno how to trigger the call otherwise)
a = call hooks.apply_patch(ui)
open a thread and trigger the binding.
See error (binding is called, but I am not asked for a path/seems like nothing happens)
Error Log