From: kaliko Date: Tue, 21 Mar 2023 16:44:48 +0000 (+0100) Subject: Add sphinx documentation X-Git-Tag: 0.3.0~10 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=refs%2Fheads%2Frtbl;p=sid.git Add sphinx documentation --- 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: