docs: Fix indentation

This commit is contained in:
2025-09-17 01:02:46 +02:00
parent 9fd62e2304
commit 92cb930810
2 changed files with 246 additions and 186 deletions

View File

@@ -8,9 +8,9 @@ occurs. You need to define them in your module and they will automatically be us
for callback events.
To utilize full functionality, such as the ``prof.cons_show`` function, see ``prof``
documentation and use:
::
import prof
documentation and use::
import prof
"""
# Initialization and Lifecycle
@@ -28,8 +28,8 @@ def prof_init(version: str, status: str, account_name: str | None, fulljid: str
:param fulljid: The full Jabber ID (barejid/resource) of the logged-in user, or None if not logged in.
:return: None
Example:
::
Example::
def prof_init(version: str, status: str, account_name: str | None, fulljid: str | None) -> None:
prof.cons_show(f"MyPlugin for CProof {version} ({status}) has been loaded, account: {account_name}")
"""
@@ -42,8 +42,8 @@ def prof_on_start() -> None:
:return: None
Example:
::
Example::
def prof_on_start() -> None:
prof.cons_show("CProof has started...")
"""
@@ -56,8 +56,8 @@ def prof_on_shutdown() -> None:
:return: None
Example:
::
Example::
def prof_on_shutdown() -> None:
prof.cons_show("CProof is shutting down...")
"""
@@ -70,8 +70,8 @@ def prof_on_unload() -> None:
:return: None
Example:
::
Example::
def prof_on_unload() -> None:
prof.cons_show("Plugin unloaded")
"""
@@ -84,8 +84,8 @@ def prof_on_connect(account_name: str, fulljid: str) -> None:
:param fulljid: The full Jabber ID (barejid/resource) of the connected account.
:return: None
Example:
::
Example::
def prof_on_connect(account_name: str, fulljid: str) -> None:
prof.cons_show(f"Connected as {account_name} ({fulljid})")
"""
@@ -98,8 +98,8 @@ def prof_on_disconnect(account_name: str, fulljid: str) -> None:
:param fulljid: The full Jabber ID (barejid/resource) of the disconnected account.
:return: None
Example:
::
Example::
def prof_on_disconnect(account_name: str, fulljid: str) -> None:
prof.cons_show(f"Disconnected {account_name} ({fulljid})")
"""
@@ -118,8 +118,8 @@ def prof_pre_chat_message_display(barejid: str, resource: str, message: str) ->
:param message: The received message.
:return: The modified message to display, or None to preserve the original.
Example:
::
Example::
def prof_pre_chat_message_display(barejid: str, resource: str, message: str) -> str | None:
new_message = f"{message} (from {barejid})"
return new_message
@@ -136,8 +136,8 @@ def prof_post_chat_message_display(barejid: str, resource: str, message: str) ->
:param message: The displayed message.
:return: None
Example:
::
Example::
def prof_post_chat_message_display(barejid: str, resource: str, message: str) -> None:
prof.cons_show(f"Displayed message from {barejid}/{resource}: {message}")
"""
@@ -152,8 +152,8 @@ def prof_pre_chat_message_send(barejid: str, message: str) -> str | None:
:param message: The message to be sent.
:return: The modified message to send, or None to cancel sending.
Example:
::
Example::
def prof_pre_chat_message_send(barejid: str, message: str) -> str | None:
return f"{message} (sent by plugin)"
"""
@@ -168,8 +168,8 @@ def prof_post_chat_message_send(barejid: str, message: str) -> None:
:param message: The sent message.
:return: None
Example:
::
Example::
def prof_post_chat_message_send(barejid: str, message: str) -> None:
prof.cons_show(f"Sent to {barejid}: {message}")
"""
@@ -188,8 +188,8 @@ def prof_pre_room_message_display(barejid: str, nick: str, message: str) -> str
:param message: The received message.
:return: The modified message to display, or None to preserve the original.
Example:
::
Example::
def prof_pre_room_message_display(barejid: str, nick: str, message: str) -> str | None:
return f"{message} (from {nick})"
"""
@@ -205,8 +205,8 @@ def prof_post_room_message_display(barejid: str, nick: str, message: str) -> Non
:param message: The displayed message.
:return: None
Example:
::
Example::
def prof_post_room_message_display(barejid: str, nick: str, message: str) -> None:
prof.cons_show(f"Displayed in {barejid} from {nick}: {message}")
"""
@@ -221,8 +221,8 @@ def prof_pre_room_message_send(barejid: str, message: str) -> str | None:
:param message: The message to be sent.
:return: The modified message to send, or None to cancel sending.
Example:
::
Example::
def prof_pre_room_message_send(barejid: str, message: str) -> str | None:
return f"{message} (sent by plugin)"
"""
@@ -237,8 +237,8 @@ def prof_post_room_message_send(barejid: str, message: str) -> None:
:param message: The sent message.
:return: None
Example:
::
Example::
def prof_post_room_message_send(barejid: str, message: str) -> None:
prof.cons_show(f"Sent to {barejid}: {message}")
"""
@@ -253,8 +253,8 @@ def prof_on_room_history_message(barejid: str, nick: str, message: str, timestam
:param timestamp: The message's original send time in ISO 8601 format (e.g., ``2025-09-10T19:45:00Z``).
:return: None
Example:
::
Example::
def prof_on_room_history_message(barejid: str, nick: str, message: str, timestamp: str) -> None:
prof.cons_show(f"History in {barejid} from {nick} at {timestamp}: {message}")
"""
@@ -273,8 +273,8 @@ def prof_pre_priv_message_display(barejid: str, nick: str, message: str) -> str
:param message: The received message.
:return: The modified message to display, or None to preserve the original.
Example:
::
Example::
def prof_pre_priv_message_display(barejid: str, nick: str, message: str) -> str | None:
return f"{message} (private from {nick})"
"""
@@ -290,8 +290,8 @@ def prof_post_priv_message_display(barejid: str, nick: str, message: str) -> Non
:param message: The displayed message.
:return: None
Example:
::
Example::
def prof_post_priv_message_display(barejid: str, nick: str, message: str) -> None:
prof.cons_show(f"Displayed private in {barejid} from {nick}: {message}")
"""
@@ -307,8 +307,8 @@ def prof_pre_priv_message_send(barejid: str, nick: str, message: str) -> str | N
:param message: The message to be sent.
:return: The modified message to send, or None to cancel sending.
Example:
::
Example::
def prof_pre_priv_message_send(barejid: str, nick: str, message: str) -> str | None:
return f"{message} (private to {nick})"
"""
@@ -324,8 +324,8 @@ def prof_post_priv_message_send(barejid: str, nick: str, message: str) -> None:
:param message: The sent message.
:return: None
Example:
::
Example::
def prof_post_priv_message_send(barejid: str, nick: str, message: str) -> None:
prof.cons_show(f"Sent private to {nick} in {barejid}: {message}")
"""
@@ -342,8 +342,8 @@ def prof_on_message_stanza_send(stanza: str) -> str | None:
:param stanza: The XMPP message stanza to send.
:return: The modified stanza to send, or None to preserve the original.
Example:
::
Example::
def prof_on_message_stanza_send(stanza: str) -> str | None:
prof.cons_show(f"Sending message stanza: {stanza}")
return stanza
@@ -358,8 +358,8 @@ def prof_on_message_stanza_receive(stanza: str) -> bool:
:param stanza: The received XMPP message stanza.
:return: True to allow CProof to process the stanza, False to block processing.
Example:
::
Example::
def prof_on_message_stanza_receive(stanza: str) -> bool:
prof.cons_show(f"Received message stanza: {stanza}")
return True
@@ -374,8 +374,8 @@ def prof_on_presence_stanza_send(stanza: str) -> str | None:
:param stanza: The XMPP presence stanza to send.
:return: The modified stanza to send, or None to preserve the original.
Example:
::
Example::
def prof_on_presence_stanza_send(stanza: str) -> str | None:
prof.cons_show(f"Sending presence stanza: {stanza}")
return stanza
@@ -390,8 +390,8 @@ def prof_on_presence_stanza_receive(stanza: str) -> bool:
:param stanza: The received XMPP presence stanza.
:return: True to allow CProof to process the stanza, False to block processing.
Example:
::
Example::
def prof_on_presence_stanza_receive(stanza: str) -> bool:
prof.cons_show(f"Received presence stanza: {stanza}")
return True
@@ -406,8 +406,8 @@ def prof_on_iq_stanza_send(stanza: str) -> str | None:
:param stanza: The XMPP IQ stanza to send.
:return: The modified stanza to send, or None to preserve the original.
Example:
::
Example::
def prof_on_iq_stanza_send(stanza: str) -> str | None:
prof.cons_show(f"Sending IQ stanza: {stanza}")
return stanza
@@ -422,8 +422,8 @@ def prof_on_iq_stanza_receive(stanza: str) -> bool:
:param stanza: The received XMPP IQ stanza.
:return: True to allow CProof to process the stanza, False to block processing.
Example:
::
Example::
def prof_on_iq_stanza_receive(stanza: str) -> bool:
prof.cons_show(f"Received IQ stanza: {stanza}")
return True
@@ -441,8 +441,8 @@ def prof_on_contact_offline(barejid: str, resource: str, status: str | None) ->
:param status: The status message received with the offline presence, or None.
:return: None
Example:
::
Example::
def prof_on_contact_offline(barejid: str, resource: str, status: str | None) -> None:
prof.cons_show(f"{barejid}/{resource} went offline: {status or 'No status'}")
"""
@@ -458,8 +458,8 @@ def prof_on_contact_presence(barejid: str, resource: str, presence: str, status:
:param priority: The priority associated with the resource.
:return: None
Example:
::
Example::
def prof_on_contact_presence(barejid: str, resource: str, presence: str, status: str | None, priority: int) -> None:
prof.notify(f"{barejid} is {presence}", 5000, "Presence")
"""
@@ -474,8 +474,8 @@ def prof_on_chat_win_focus(barejid: str) -> None:
:param barejid: The Jabber ID of the chat window recipient (e.g., ``bob@example.com``).
:return: None
Example:
::
Example::
def prof_on_chat_win_focus(barejid: str) -> None:
prof.cons_show(f"Focused chat window for {barejid}")
"""
@@ -487,8 +487,8 @@ def prof_on_room_win_focus(barejid: str) -> None:
:param barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
:return: None
Example:
::
Example::
def prof_on_room_win_focus(barejid: str) -> None:
prof.cons_show(f"Focused room window for {barejid}")
"""