diff options
| author | 2019-06-29 21:33:26 +0100 | |
|---|---|---|
| committer | 2019-06-29 21:33:26 +0100 | |
| commit | b4c762eb4ea1a83556dac95d6b248e6bcf220843 (patch) | |
| tree | 28cd655dcfdc45a48b72399f7a5c2241600def57 /modules | |
| parent | Only accept highlight-commands when they have "," or ":" (diff) | |
| signature | ||
Automatically format `example` text for OptionsSetting (showing options)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/channel_op.py | 3 | ||||
| -rw-r--r-- | modules/config.py | 6 | ||||
| -rw-r--r-- | modules/permissions/__init__.py | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py index 749e7764..4b2dbe15 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -20,8 +20,7 @@ class InvalidTimeoutException(Exception): "Set ban format ($n = nick, $u = username, $h = hostname)", example="*!$u@$h")) @utils.export("serverset", utils.OptionsSetting("mute-method", - ["qmode", "insp", "unreal"], "Set this server's method of muting users", - example="qmode")) + ["qmode", "insp", "unreal"], "Set this server's method of muting users")) class Module(ModuleManager.BaseModule): _name = "ChanOp" diff --git a/modules/config.py b/modules/config.py index 8c070e0d..306f2366 100644 --- a/modules/config.py +++ b/modules/config.py @@ -84,7 +84,7 @@ class Module(ModuleManager.BaseModule): if setting_info: value = target.get_setting(require_setting, None) if value == None: - example = setting_info.exaple or "<value>" + example = setting_info.get_example() or "<value>" return "Please set %s, e.g.: %sconfig %s %s %s" % ( require_setting, event["command_prefix"], context[0], require_setting, example) @@ -180,9 +180,9 @@ class Module(ModuleManager.BaseModule): try: result = self._config(export_settings, target, setting, value) except ConfigInvalidValue: - example = export_settings[setting].example + example = export_settings[setting].get_example() if not example == None: - raise utils.EventError("Invalid value. Example: %s" % + raise utils.EventError("Invalid value. %s" % example) else: raise utils.EventError("Invalid value") diff --git a/modules/permissions/__init__.py b/modules/permissions/__init__.py index aae4d500..f1949b9a 100644 --- a/modules/permissions/__init__.py +++ b/modules/permissions/__init__.py @@ -10,8 +10,8 @@ REQUIRES_IDENTIFY_INTERNAL = ("You need to be identified to use that command " "(/msg %s register | /msg %s identify)") @utils.export("serverset", utils.OptionsSetting("identity-mechanism", - ["internal", "ircv3-account"], "Set the identity mechanism for this server", - example="ircv3-account")) + ["internal", "ircv3-account"], + "Set the identity mechanism for this server")) class Module(ModuleManager.BaseModule): @utils.hook("new.user") def new_user(self, event): |
