From 9a43622cb1bbad11d425783119817b1f0ac7aae7 Mon Sep 17 00:00:00 2001 From: Jabber Developer Date: Wed, 17 Sep 2025 01:02:46 +0200 Subject: [PATCH] docs: Fix indentation --- apidocs/python/src/prof.py | 304 ++++++++++++++++++------------------- 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/apidocs/python/src/prof.py b/apidocs/python/src/prof.py index d42168ee..c7ec2fee 100644 --- a/apidocs/python/src/prof.py +++ b/apidocs/python/src/prof.py @@ -33,9 +33,9 @@ class TimedCallback(Protocol): :return: None Example: - :: - def my_timed_callback() -> None: - prof.cons_show("Timer triggered") + :: + def my_timed_callback() -> None: + prof.cons_show("Timer triggered") """ def __call__(self) -> None: ... @@ -47,9 +47,9 @@ class WindowCallback(Protocol): :return: None Example: - :: - def my_window_callback(win_id: str, message: str) -> None: - prof.win_show(win_id, f"Processed: {message}") + :: + def my_window_callback(win_id: str, message: str) -> None: + prof.win_show(win_id, f"Processed: {message}") """ def __call__(self, win_id: str, message: str) -> None: ... @@ -62,8 +62,8 @@ def cons_alert() -> None: :return: None Example: - :: - prof.cons_alert() # Highlights the console window + :: + prof.cons_alert() # Highlights the console window """ pass @@ -74,8 +74,8 @@ def cons_show(message: str) -> None: :return: None Example: - :: - prof.cons_show("This appears in the console window") + :: + prof.cons_show("This appears in the console window") """ pass @@ -92,8 +92,8 @@ def cons_show_themed(group: str | None, key: str | None, default: str | None, me :return: None Example: - :: - prof.cons_show_themed("myplugin", "text", "white", "Themed message") + :: + prof.cons_show_themed("myplugin", "text", "white", "Themed message") """ pass @@ -104,8 +104,8 @@ def cons_bad_cmd_usage(command: str) -> None: :return: None Example: - :: - prof.cons_bad_cmd_usage("/mycommand") # Shows usage error for /mycommand + :: + prof.cons_bad_cmd_usage("/mycommand") # Shows usage error for /mycommand """ pass @@ -139,26 +139,26 @@ def register_command( :return: None Example: - :: - def command_handler(*args: str) -> None: - prof.cons_show(f"Received: {args}") - if len(args) == 1 and args[0] in ("on", "off"): - prof.cons_show(f"{args[0].capitalize()}ing something") - elif len(args) == 2 and args[0] == "print": - prof.cons_show(args[1]) - else: - prof.cons_bad_cmd_usage("/new_command") + :: + def command_handler(*args: str) -> None: + prof.cons_show(f"Received: {args}") + if len(args) == 1 and args[0] in ("on", "off"): + prof.cons_show(f"{args[0].capitalize()}ing something") + elif len(args) == 2 and args[0] == "print": + prof.cons_show(args[1]) + else: + prof.cons_bad_cmd_usage("/new_command") - synopsis = ["/new_command on|off", "/new_command print "] - description = "Enables, disables, or prints an argument." - arguments = [ - ["on|off", "Enable or disable something."], - ["print ", "Print the argument."] - ] - examples = ["/new_command on", "/new_command print 'test'"] - prof.register_command( - "/new_command", 1, 2, synopsis, description, arguments, examples, command_handler - ) + synopsis = ["/new_command on|off", "/new_command print "] + description = "Enables, disables, or prints an argument." + arguments = [ + ["on|off", "Enable or disable something."], + ["print ", "Print the argument."] + ] + examples = ["/new_command on", "/new_command print 'test'"] + prof.register_command( + "/new_command", 1, 2, synopsis, description, arguments, examples, command_handler + ) """ pass @@ -173,11 +173,11 @@ def register_timed(callback: TimedCallback, interval: int) -> None: :return: None Example: - :: - def periodic_task() -> None: - prof.cons_show("Periodic update") + :: + def periodic_task() -> None: + prof.cons_show("Periodic update") - prof.register_timed(periodic_task, 30) # Calls every 30 seconds + prof.register_timed(periodic_task, 30) # Calls every 30 seconds """ pass @@ -195,9 +195,9 @@ def completer_add(key: str, items: list[str]) -> None: :return: None Example: - :: - prof.completer_add("/mycommand", ["action1", "action2"]) - prof.completer_add("/mycommand dosomething", ["thing1", "thing2"]) + :: + prof.completer_add("/mycommand", ["action1", "action2"]) + prof.completer_add("/mycommand dosomething", ["thing1", "thing2"]) """ pass @@ -209,8 +209,8 @@ def completer_remove(key: str, items: list[str]) -> None: :return: None Example: - :: - prof.completer_remove("/mycommand", ["action1", "action2"]) + :: + prof.completer_remove("/mycommand", ["action1", "action2"]) """ pass @@ -221,8 +221,8 @@ def completer_clear(key: str) -> None: :return: None Example: - :: - prof.completer_clear("/mycommand") + :: + prof.completer_clear("/mycommand") """ pass @@ -233,8 +233,8 @@ def filepath_completer_add(prefix: str) -> None: :return: None Example: - :: - prof.filepath_completer_add("/filecmd") # Enables filepath completion + :: + prof.filepath_completer_add("/filecmd") # Enables filepath completion """ pass @@ -248,9 +248,9 @@ def win_exists(tag: str) -> bool: :return: True if the window exists, False otherwise. Example: - :: - if prof.win_exists("MyPlugin"): - prof.cons_show("Window exists") + :: + if prof.win_exists("MyPlugin"): + prof.cons_show("Window exists") """ pass @@ -265,11 +265,11 @@ def win_create(tag: str, callback: WindowCallback) -> None: :return: None Example: - :: - def handler(win_id: str, message: str) -> None: - prof.win_show(win_id, f"Processed: {message}") + :: + def handler(win_id: str, message: str) -> None: + prof.win_show(win_id, f"Processed: {message}") - prof.win_create("MyPlugin", handler) + prof.win_create("MyPlugin", handler) """ pass @@ -280,8 +280,8 @@ def win_focus(tag: str) -> None: :return: None Example: - :: - prof.win_focus("MyPlugin") # Focuses the MyPlugin window + :: + prof.win_focus("MyPlugin") # Focuses the MyPlugin window """ pass @@ -293,8 +293,8 @@ def win_show(tag: str, message: str) -> None: :return: None Example: - :: - prof.win_show("MyPlugin", "Message in plugin window") + :: + prof.win_show("MyPlugin", "Message in plugin window") """ pass @@ -312,8 +312,8 @@ def win_show_themed(tag: str, group: str | None, key: str | None, default: str | :return: None Example: - :: - prof.win_show_themed("MyPlugin", "myplugin", "text", "white", "Themed message") + :: + prof.win_show_themed("MyPlugin", "myplugin", "text", "white", "Themed message") """ pass @@ -328,9 +328,9 @@ def chat_show(barejid: str, message: str) -> bool: :return: True if the message was displayed, False if the chat window does not exist. Example: - :: - if prof.chat_show("bob@example.com", "Hello from plugin"): - prof.cons_show("Message displayed") + :: + if prof.chat_show("bob@example.com", "Hello from plugin"): + prof.cons_show("Message displayed") """ pass @@ -356,8 +356,8 @@ def chat_show_themed( :return: True if the message was displayed, False if the chat window does not exist. Example: - :: - prof.chat_show_themed("bob@example.com", "myplugin", "text", None, "!", "Themed message") + :: + prof.chat_show_themed("bob@example.com", "myplugin", "text", None, "!", "Themed message") """ pass @@ -369,8 +369,8 @@ def room_show(roomjid: str, message: str) -> bool: :return: True if the message was displayed, False if the room window does not exist. Example: - :: - prof.room_show("chat@conference.example.com", "Room message from plugin") + :: + prof.room_show("chat@conference.example.com", "Room message from plugin") """ pass @@ -396,8 +396,8 @@ def room_show_themed( :return: True if the message was displayed, False if the room window does not exist. Example: - :: - prof.room_show_themed("chat@conference.example.com", "myplugin", "text", None, "!", "Themed room message") + :: + prof.room_show_themed("chat@conference.example.com", "myplugin", "text", None, "!", "Themed room message") """ pass @@ -423,10 +423,10 @@ def send_stanza(stanza: str) -> bool: :return: True if the stanza was sent successfully, False if it was invalid or failed to send. Example: - :: - stanza = "" - if prof.send_stanza(stanza): - prof.cons_show("Stanza sent successfully") + :: + stanza = "" + if prof.send_stanza(stanza): + prof.cons_show("Stanza sent successfully") """ pass @@ -439,8 +439,8 @@ def incoming_message(barejid: str, resource: str, message: str) -> None: :return: None Example: - :: - prof.incoming_message("bob@example.com", "laptop", "Hello from plugin") + :: + prof.incoming_message("bob@example.com", "laptop", "Hello from plugin") """ pass @@ -454,8 +454,8 @@ def disco_add_feature(feature: str) -> None: :return: None Example: - :: - prof.disco_add_feature("urn:xmpp:omemo:0:devicelist+notify") + :: + prof.disco_add_feature("urn:xmpp:omemo:0:devicelist+notify") """ pass @@ -466,8 +466,8 @@ def encryption_reset(barejid: str) -> None: :return: None Example: - :: - prof.encryption_reset("alice@example.com") # Resets encryption + :: + prof.encryption_reset("alice@example.com") # Resets encryption """ pass @@ -479,8 +479,8 @@ def chat_set_titlebar_enctext(barejid: str, enctext: str) -> bool: :return: True if the text was set, False if the chat window does not exist. Example: - :: - prof.chat_set_titlebar_enctext("bob@example.com", "secure") + :: + prof.chat_set_titlebar_enctext("bob@example.com", "secure") """ pass @@ -493,8 +493,8 @@ def chat_unset_titlebar_enctext(barejid: str) -> bool: :return: True if the text was reset, False if the chat window does not exist. Example: - :: - prof.chat_unset_titlebar_enctext("bob@example.com") + :: + prof.chat_unset_titlebar_enctext("bob@example.com") """ pass @@ -518,8 +518,8 @@ def chat_unset_incoming_char(barejid: str) -> bool: :return: True if the character was reset, False if the chat window does not exist. Example: - :: - prof.chat_unset_incoming_char("bob@example.com") + :: + prof.chat_unset_incoming_char("bob@example.com") """ pass @@ -531,8 +531,8 @@ def chat_set_outgoing_char(barejid: str, ch: str) -> bool: :return: True if the character was set, False if the chat window does not exist. Example: - :: - prof.chat_set_outgoing_char("bob@example.com", "+") + :: + prof.chat_set_outgoing_char("bob@example.com", "+") """ pass @@ -543,8 +543,8 @@ def chat_unset_outgoing_char(barejid: str) -> bool: :return: True if the character was reset, False if the chat window does not exist. Example: - :: - prof.chat_unset_outgoing_char("bob@example.com") + :: + prof.chat_unset_outgoing_char("bob@example.com") """ pass @@ -556,8 +556,8 @@ def room_set_titlebar_enctext(roomjid: str, enctext: str) -> bool: :return: True if the text was set, False if the room window does not exist. Example: - :: - prof.room_set_titlebar_enctext("chat@conference.example.com", "secure") + :: + prof.room_set_titlebar_enctext("chat@conference.example.com", "secure") """ pass @@ -570,8 +570,8 @@ def room_unset_titlebar_enctext(roomjid: str) -> bool: :return: True if the text was reset, False if the room window does not exist. Example: - :: - prof.room_unset_titlebar_enctext("chat@conference.example.com") + :: + prof.room_unset_titlebar_enctext("chat@conference.example.com") """ pass @@ -583,8 +583,8 @@ def room_set_message_char(roomjid: str, ch: str) -> bool: :return: True if the character was set, False if the room window does not exist. Example: - :: - prof.room_set_message_char("chat@conference.example.com", "^") + :: + prof.room_set_message_char("chat@conference.example.com", "^") """ pass @@ -595,8 +595,8 @@ def room_unset_message_char(roomjid: str) -> bool: :return: True if the character was reset, False if the room window does not exist. Example: - :: - prof.room_unset_message_char("chat@conference.example.com") + :: + prof.room_unset_message_char("chat@conference.example.com") """ pass @@ -614,8 +614,8 @@ def settings_boolean_get(group: str, key: str, default: bool) -> bool: :return: The setting value, or the default if not found. Example: - :: - notify = prof.settings_boolean_get("myplugin", "notify", False) + :: + notify = prof.settings_boolean_get("myplugin", "notify", False) """ pass @@ -646,8 +646,8 @@ def settings_string_get(group: str, key: str, default: str) -> str: :return: The setting value, or the default if not found. Example: - :: - prefix = prof.settings_string_get("myplugin", "prefix", "myplugin>") + :: + prefix = prof.settings_string_get("myplugin", "prefix", "myplugin>") """ pass @@ -662,8 +662,8 @@ def settings_string_set(group: str, key: str, value: str) -> None: :return: None Example: - :: - prof.settings_string_set("myplugin", "prefix", "myplugin>") + :: + prof.settings_string_set("myplugin", "prefix", "myplugin>") """ pass @@ -678,8 +678,8 @@ def settings_string_list_get(group: str, key: str) -> list[str]: :return: List of strings, or an empty list if the setting does not exist. Example: - :: - items = prof.settings_string_list_get("myplugin", "items") + :: + items = prof.settings_string_list_get("myplugin", "items") """ pass @@ -695,8 +695,8 @@ def settings_string_list_add(group: str, key: str, value: str) -> None: :return: None Example: - :: - prof.settings_string_list_add("myplugin", "items", "item1") + :: + prof.settings_string_list_add("myplugin", "items", "item1") """ pass @@ -711,8 +711,8 @@ def settings_string_list_remove(group: str, key: str, value: str) -> bool: :return: True if the item was removed or not in the list, False if the list does not exist. Example: - :: - prof.settings_string_list_remove("myplugin", "items", "item1") + :: + prof.settings_string_list_remove("myplugin", "items", "item1") """ pass @@ -726,8 +726,8 @@ def settings_string_list_clear(group: str, key: str) -> bool: :return: True if the list was cleared, False if the list does not exist. Example: - :: - prof.settings_string_list_clear("myplugin", "items") + :: + prof.settings_string_list_clear("myplugin", "items") """ pass @@ -742,8 +742,8 @@ def settings_int_get(group: str, key: str, default: int) -> int: :return: The setting value, or the default if not found. Example: - :: - timeout = prof.settings_int_get("myplugin", "timeout", 10) + :: + timeout = prof.settings_int_get("myplugin", "timeout", 10) """ pass @@ -758,8 +758,8 @@ def settings_int_set(group: str, key: str, value: int) -> None: :return: None Example: - :: - prof.settings_int_set("myplugin", "timeout", 100) + :: + prof.settings_int_set("myplugin", "timeout", 100) """ pass @@ -772,10 +772,10 @@ def get_current_recipient() -> str | None: :return: The Jabber ID of the recipient (e.g., ``bob@example.com``), or None if not in a chat window. Example: - :: - recipient = prof.get_current_recipient() - if recipient: - prof.cons_show(f"Chatting with: {recipient}") + :: + recipient = prof.get_current_recipient() + if recipient: + prof.cons_show(f"Chatting with: {recipient}") """ pass @@ -785,10 +785,10 @@ def get_current_muc() -> str | None: :return: The Jabber ID of the room (e.g., ``chat@conference.example.com``), or None if not in a chat room window. Example: - :: - room = prof.get_current_muc() - if room: - prof.cons_show(f"In room: {room}") + :: + room = prof.get_current_muc() + if room: + prof.cons_show(f"In room: {room}") """ pass @@ -798,10 +798,10 @@ def get_current_nick() -> str | None: :return: The user's nickname (e.g., ``alice``), or None if not in a chat room window. Example: - :: - nick = prof.get_current_nick() - if nick: - prof.cons_show(f"Nickname: {nick}") + :: + nick = prof.get_current_nick() + if nick: + prof.cons_show(f"Nickname: {nick}") """ pass @@ -812,9 +812,9 @@ def get_name_from_roster(barejid: str) -> str: :return: The nickname from the roster, or the input barejid if not found. Example: - :: - name = prof.get_name_from_roster("bob@example.com") - prof.cons_show(f"Name: {name}") + :: + name = prof.get_name_from_roster("bob@example.com") + prof.cons_show(f"Name: {name}") """ pass @@ -825,10 +825,10 @@ def get_barejid_from_roster(name: str) -> str | None: :return: The Jabber ID (e.g., ``bob@example.com``), or None if the nickname is not in the roster. Example: - :: - jid = prof.get_barejid_from_roster("bob") - if jid: - prof.cons_show(f"JID: {jid}") + :: + jid = prof.get_barejid_from_roster("bob") + if jid: + prof.cons_show(f"JID: {jid}") """ pass @@ -838,9 +838,9 @@ def get_current_occupants() -> list[str]: :return: List of occupant nicknames, or an empty list if not in a chat room window. Example: - :: - occupants = prof.get_current_occupants() - prof.cons_show(f"Occupants: {', '.join(occupants)}") + :: + occupants = prof.get_current_occupants() + prof.cons_show(f"Occupants: {', '.join(occupants)}") """ pass @@ -851,9 +851,9 @@ def get_room_nick(barejid: str) -> str: :return: The user's nickname in the room. Example: - :: - nick = prof.get_room_nick("chat@conference.example.com") - prof.cons_show(f"Room nick: {nick}") + :: + nick = prof.get_room_nick("chat@conference.example.com") + prof.cons_show(f"Room nick: {nick}") """ pass @@ -863,9 +863,9 @@ def current_win_is_console() -> bool: :return: True if the console window is focused, False otherwise. Example: - :: - if prof.current_win_is_console(): - prof.cons_show("Console is focused") + :: + if prof.current_win_is_console(): + prof.cons_show("Console is focused") """ pass @@ -881,8 +881,8 @@ def notify(message: str, timeout: int, category: str) -> None: :return: None Example: - :: - prof.notify("New message received", 5000, "MyPlugin") + :: + prof.notify("New message received", 5000, "MyPlugin") """ pass @@ -893,8 +893,8 @@ def log_debug(message: str) -> None: :return: None Example: - :: - prof.log_debug("Debugging plugin initialization") + :: + prof.log_debug("Debugging plugin initialization") """ pass @@ -905,8 +905,8 @@ def log_info(message: str) -> None: :return: None Example: - :: - prof.log_info("Plugin started successfully") + :: + prof.log_info("Plugin started successfully") """ pass @@ -917,8 +917,8 @@ def log_warning(message: str) -> None: :return: None Example: - :: - prof.log_warning("Configuration issue detected") + :: + prof.log_warning("Configuration issue detected") """ pass @@ -929,7 +929,7 @@ def log_error(message: str) -> None: :return: None Example: - :: - prof.log_error("Failed to connect to server") + :: + prof.log_error("Failed to connect to server") """ pass \ No newline at end of file