mirror of
https://github.com/weechat/weechat.git
synced 2026-06-24 11:56:38 +02:00
doc/plugin: fix Python example of function hook_connect
This commit is contained in:
@@ -1474,27 +1474,27 @@ def hook_connect(proxy: str, address: str, port: int, ipv6: int, retry: int, loc
|
||||
|
||||
# example
|
||||
def my_connect_cb(data: str, status: int, gnutls_rc: int, sock: int, error: str, ip_address: str) -> int:
|
||||
if status == WEECHAT_HOOK_CONNECT_OK:
|
||||
if status == weechat.WEECHAT_HOOK_CONNECT_OK:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_PROXY_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_PROXY_ERROR:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_TIMEOUT:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_TIMEOUT:
|
||||
# ...
|
||||
elif status == WEECHAT_HOOK_CONNECT_SOCKET_ERROR:
|
||||
elif status == weechat.WEECHAT_HOOK_CONNECT_SOCKET_ERROR:
|
||||
# ...
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
|
||||
Reference in New Issue
Block a user