Remove debug message and internationalize config.py in ChannelStats

This commit is contained in:
Valentin Lorentz 2010-10-10 15:11:41 +02:00
parent a750fe6a2e
commit a8319d3c6f
3 changed files with 9 additions and 152 deletions

View File

@ -31,6 +31,9 @@ import re
import supybot.conf as conf import supybot.conf as conf
import supybot.registry as registry import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('ChannelStats')
def configure(advanced): def configure(advanced):
# This will be called by supybot to configure this module. advanced is # This will be called by supybot to configure this module. advanced is
@ -54,16 +57,16 @@ class Smileys(registry.Value):
ChannelStats = conf.registerPlugin('ChannelStats') ChannelStats = conf.registerPlugin('ChannelStats')
conf.registerChannelValue(ChannelStats, 'selfStats', conf.registerChannelValue(ChannelStats, 'selfStats',
registry.Boolean(True, """Determines whether the bot will keep channel registry.Boolean(True, _("""Determines whether the bot will keep channel
statistics on itself, possibly skewing the channel stats (especially in statistics on itself, possibly skewing the channel stats (especially in
cases where the bot is relaying between channels on a network).""")) cases where the bot is relaying between channels on a network).""")))
conf.registerChannelValue(ChannelStats, 'smileys', conf.registerChannelValue(ChannelStats, 'smileys',
Smileys(':) ;) ;] :-) :-D :D :P :p (= =)'.split(), """Determines what Smileys(':) ;) ;] :-) :-D :D :P :p (= =)'.split(), _("""Determines what
words (i.e., pieces of text with no spaces in them) are considered words (i.e., pieces of text with no spaces in them) are considered
'smileys' for the purposes of stats-keeping.""")) 'smileys' for the purposes of stats-keeping.""")))
conf.registerChannelValue(ChannelStats, 'frowns', conf.registerChannelValue(ChannelStats, 'frowns',
Smileys(':| :-/ :-\\ :\\ :/ :( :-( :\'('.split(), """Determines what words Smileys(':| :-/ :-\\ :\\ :/ :( :-( :\'('.split(), _("""Determines what words
(i.e., pieces of text with no spaces in them ) are considered 'frowns' for (i.e., pieces of text with no spaces in them ) are considered 'frowns' for
the purposes of stats-keeping.""")) the purposes of stats-keeping.""")))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -1,144 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2010-10-10 09:35+CEST\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: plugin.py:246
#, docstring
msgid ""
"[<channel>] [<name>]\n"
"\n"
" Returns the statistics for <name> on <channel>. <channel> is only\n"
" necessary if the message isn't sent on the channel itself. If <name>\n"
" isn't given, it defaults to the user sending the command.\n"
" "
msgstr ""
#: plugin.py:259
msgid "I couldn't find you in my user database."
msgstr ""
#: plugin.py:272
msgid "%s has sent %n; a total of %n, %n, %n, and %n; %s of those messages %s. %s has joined %n, parted %n, quit %n, kicked someone %n, been kicked %n, changed the topic %n, and changed the mode %n."
msgstr ""
#: plugin.py:279
msgid "character"
msgstr ""
#: plugin.py:280 plugin.py:363
msgid "word"
msgstr ""
#: plugin.py:281 plugin.py:364
msgid "smiley"
msgstr ""
#: plugin.py:282 plugin.py:365
msgid "frown"
msgstr ""
#: plugin.py:284 plugin.py:366
msgid "was an ACTION"
msgstr ""
#: plugin.py:285 plugin.py:367
msgid "were ACTIONs"
msgstr ""
#: plugin.py:287 plugin.py:288 plugin.py:289 plugin.py:290 plugin.py:291
#: plugin.py:292 plugin.py:293
msgid "time"
msgstr ""
#: plugin.py:296
msgid "I have no stats for that %s in %s."
msgstr ""
#: plugin.py:304
#, docstring
msgid ""
"[<channel>] <stat expression>\n"
"\n"
" Returns the ranking of users according to the given stat expression.\n"
" Valid variables in the stat expression include 'msgs', 'chars',\n"
" 'words', 'smileys', 'frowns', 'actions', 'joins', 'parts', 'quits',\n"
" 'kicks', 'kicked', 'topics', and 'modes'. Any simple mathematical\n"
" expression involving those variables is permitted.\n"
" "
msgstr ""
#: plugin.py:315
msgid "There's really no reason why you should have underscores or brackets in your mathematical expression. Please remove them."
msgstr ""
#: plugin.py:319
msgid "You can't use lambda in this command."
msgstr ""
#: plugin.py:333
msgid "stat variable"
msgstr ""
#: plugin.py:349
#, docstring
msgid ""
"[<channel>]\n"
"\n"
" Returns the statistics for <channel>. <channel> is only necessary if\n"
" the message isn't sent on the channel itself.\n"
" "
msgstr ""
#: plugin.py:357
msgid "On %s there %h been %i messages, containing %i characters, %n, %n, and %n; %i of those messages %s. There have been %n, %n, %n, %n, %n, and %n. There %b currently %n and the channel has peaked at %n."
msgstr ""
#: plugin.py:368
msgid "join"
msgstr ""
#: plugin.py:369
msgid "part"
msgstr ""
#: plugin.py:370
msgid "quit"
msgstr ""
#: plugin.py:371
msgid "kick"
msgstr ""
#: plugin.py:372
msgid "mode"
msgstr ""
#: plugin.py:372 plugin.py:373
msgid "change"
msgstr ""
#: plugin.py:373
msgid "topic"
msgstr ""
#: plugin.py:375 plugin.py:376
msgid "user"
msgstr ""
#: plugin.py:379
msgid "I've never been on %s."
msgstr ""

View File

@ -155,7 +155,5 @@ class PluginInternationalization:
def internationalizeDocstring(obj): def internationalizeDocstring(obj):
# FIXME: check if the plugin has an _ object # FIXME: check if the plugin has an _ object
internationalizedCommands.update({hash(obj): obj}) internationalizedCommands.update({hash(obj): obj})
print "----doc : " + repr(obj.__doc__)
print "----strings : " + repr(sys.modules[obj.__module__]._.translations.keys())
obj.__doc__=sys.modules[obj.__module__]._(obj.__doc__) obj.__doc__=sys.modules[obj.__module__]._(obj.__doc__)
return obj return obj