Rename supybot.reply.format.databaseRecord to supybot.replies.databaseRecord.

This commit is contained in:
Valentin Lorentz 2020-05-15 18:56:03 +02:00
parent 376917b1b8
commit ddce09d257
2 changed files with 12 additions and 11 deletions

View File

@ -443,7 +443,7 @@ class ChannelIdDatabasePlugin(callbacks.Plugin):
additional(rest('glob'))]) additional(rest('glob'))])
def showRecord(self, record): def showRecord(self, record):
template = string.Template(conf.supybot.reply.format.databaseRecord()) template = string.Template(conf.supybot.replies.databaseRecord())
username = getUserName(record.by) username = getUserName(record.by)
nick = username.split('!')[0] # nick==username iff this is a registered user nick = username.split('!')[0] # nick==username iff this is a registered user
return template.substitute( return template.substitute(

View File

@ -501,16 +501,6 @@ def commaAndify(seq, *args, **kwargs):
return originalCommaAndify(seq, *args, **kwargs) return originalCommaAndify(seq, *args, **kwargs)
utils.str.commaAndify = commaAndify 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', registerGlobalValue(supybot.reply, 'maximumLength',
registry.Integer(512*256, _("""Determines the absolute maximum length of 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 the bot's reply -- no reply will be passed through the bot with a length
@ -739,6 +729,17 @@ registerChannelValue(supybot.replies, 'possibleBug',
<https://github.com/ProgVal/Limnoria/issues>."""), <https://github.com/ProgVal/Limnoria/issues>."""),
_("""Determines what message the bot sends when it thinks you've _("""Determines what message the bot sends when it thinks you've
encountered a bug that the developers don't know about."""))) 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. # End supybot.replies.
### ###