From ddce09d257d894bbc3d64366b58fd5b7f1e415f4 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 15 May 2020 18:56:03 +0200 Subject: [PATCH] Rename supybot.reply.format.databaseRecord to supybot.replies.databaseRecord. --- plugins/__init__.py | 2 +- src/conf.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/__init__.py b/plugins/__init__.py index 2143b7855..aec351704 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -443,7 +443,7 @@ class ChannelIdDatabasePlugin(callbacks.Plugin): additional(rest('glob'))]) def showRecord(self, record): - template = string.Template(conf.supybot.reply.format.databaseRecord()) + template = string.Template(conf.supybot.replies.databaseRecord()) username = getUserName(record.by) nick = username.split('!')[0] # nick==username iff this is a registered user return template.substitute( diff --git a/src/conf.py b/src/conf.py index 2b89d6396..4ba59c765 100644 --- a/src/conf.py +++ b/src/conf.py @@ -501,16 +501,6 @@ def commaAndify(seq, *args, **kwargs): return originalCommaAndify(seq, *args, **kwargs) utils.str.commaAndify = commaAndify -class DatabaseRecordTemplatedString(registry.TemplatedString): - requiredTemplates = ['text'] - -registerChannelValue(supybot.reply.format, 'databaseRecord', - DatabaseRecordTemplatedString(_('$Type #$id: $text (added by $username at $at)'), - _("""Format used by generic database plugins (Lart, Dunno, Prase, Success, - Quote, ...) to show an entry. You can use the following variables: - $type/$types/$Type/$Types (plugin name and variants), $id, $text, - $at (creation time), $userid/$username/$nick (author)."""))) - registerGlobalValue(supybot.reply, 'maximumLength', registry.Integer(512*256, _("""Determines the absolute maximum length of the bot's reply -- no reply will be passed through the bot with a length @@ -739,6 +729,17 @@ registerChannelValue(supybot.replies, 'possibleBug', ."""), _("""Determines what message the bot sends when it thinks you've encountered a bug that the developers don't know about."""))) + +class DatabaseRecordTemplatedString(registry.TemplatedString): + requiredTemplates = ['text'] + +registerChannelValue(supybot.replies, 'databaseRecord', + DatabaseRecordTemplatedString(_('$Type #$id: $text (added by $username at $at)'), + _("""Format used by generic database plugins (Lart, Dunno, Prase, Success, + Quote, ...) to show an entry. You can use the following variables: + $type/$types/$Type/$Types (plugin name and variants), $id, $text, + $at (creation time), $userid/$username/$nick (author)."""))) + ### # End supybot.replies. ###