From cf4e0e61fd723ec820449c6dd26a820514404c63 Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 21 Mar 2023 17:44:48 +0100 Subject: [PATCH] Add sphinx documentation --- doc/source/plugins.rst | 4 ++++ sid/rtbl.py | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/source/plugins.rst b/doc/source/plugins.rst index cd0aa26..e7c4fdb 100644 --- a/doc/source/plugins.rst +++ b/doc/source/plugins.rst @@ -16,6 +16,10 @@ Generic plugins :members: :show-inheritance: +.. autoclass:: sid.rtbl.RTBL + :members: + :show-inheritance: + Debian plugins -------------- diff --git a/sid/rtbl.py b/sid/rtbl.py index 44f5ca4..13e5c91 100644 --- a/sid/rtbl.py +++ b/sid/rtbl.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -# SPDX-FileCopyrightText: 2014, 2020, 2023 kaliko -# SPDX-FileCopyrightText: 2007-2012 Thomas Perl +# SPDX-FileCopyrightText: 2023 kaliko # SPDX-License-Identifier: GPL-3.0-or-later """A Real Time Block List plugin""" @@ -20,7 +19,8 @@ def jid_to_sha256(jid: JID) -> str: class BL: - """Plain object to keep track of block list items""" + """Plain object to keep track of block list items. + Only used in RTBL plugin.""" def __init__(self, initial_bl): self.sha256_jids: Dict[str, Optional[str]] = {} @@ -59,9 +59,11 @@ class BL: class RTBL(Plugin): - """Spam guard for MUC + """Spam guard plugin for MUC. """ + #: Pubsub server pubsub_server = 'example.org' + #: Pubsub server node to subscribe to node = 'muc_bans_sha256' def __init__(self, bot): @@ -154,7 +156,7 @@ class RTBL(Plugin): await self.ban(jid.bare, reason=reason) def got_offline(self, pres): - """Handler method for laving MUC participants""" + """Handler method for leaving MUC participants""" fjid = pres['muc']['jid'] user = fjid if fjid.full else pres['muc']['nick'] try: -- 2.39.2