From b2a8b0729d2bf7134935b81a7516d0b0010e9dc7 Mon Sep 17 00:00:00 2001 From: dgw Date: Tue, 20 Oct 2020 16:16:54 -0500 Subject: [PATCH 1/2] plugin: keep old-school plugin devs happy w/plural command decorators The aliases' docstrings should prevent Sphinx from outputting the same documentation twice; a simple link to the main definition is enough. --- sopel/plugin.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sopel/plugin.py b/sopel/plugin.py index 85a04f3d8e..207d3649ab 100644 --- a/sopel/plugin.py +++ b/sopel/plugin.py @@ -18,7 +18,9 @@ 'NOLIMIT', 'VOICE', 'HALFOP', 'OP', 'ADMIN', 'OWNER', 'OPER', # decorators 'action_command', + 'action_commands', 'command', + 'commands', 'echo', 'event', 'example', @@ -27,6 +29,7 @@ 'interval', 'label', 'nickname_command', + 'nickname_commands', 'output_prefix', 'priority', 'rate', @@ -455,6 +458,10 @@ def add_attribute(function): return add_attribute +commands = command +"""Alias to :func:`command`.""" + + def nickname_command(*command_list): """Decorate a function to trigger on lines starting with "$nickname: command". @@ -501,6 +508,10 @@ def add_attribute(function): return add_attribute +nickname_commands = nickname_command +"""Alias to :func:`nickname_command`.""" + + def action_command(*command_list): """Decorate a function to trigger on CTCP ACTION lines. @@ -546,6 +557,10 @@ def add_attribute(function): return add_attribute +action_commands = action_command +"""Alias to :func:`action_command`.""" + + def label(value): """Decorate a function to add a rule label. From 3d7ec8f8fe4e06c79d64856cfb111103efc4578e Mon Sep 17 00:00:00 2001 From: dgw Date: Wed, 21 Oct 2020 17:33:44 -0500 Subject: [PATCH 2/2] module: `as` imports are no longer needed --- sopel/module.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sopel/module.py b/sopel/module.py index d2b4c26153..6832e93c99 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -13,15 +13,15 @@ # Therefore, don't add anything to this import list. Ever. from sopel.plugin import ( # noqa ADMIN, - action_command as action_commands, - command as commands, + action_commands, + commands, echo, event, example, HALFOP, intent, interval, - nickname_command as nickname_commands, + nickname_commands, NOLIMIT, OP, OPER,