mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Wrap now internationalizes docstrings.
This commit is contained in:
parent
66025cf7e4
commit
c56f26b91d
@ -97,15 +97,12 @@ import supybot.ircutils as ircutils
|
||||
import supybot.callbacks as callbacks
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
from supybot.i18n import internationalizeDocstring
|
||||
_ = PluginInter
|
||||
_ = PluginInternationalization('%s')
|
||||
except:
|
||||
# These are useless functions that's allow to run the plugin on a bot
|
||||
# without the i18n plugin
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
_ = lambda x:x
|
||||
internationalizeDocstring = lambda x:xnationalization('%s')
|
||||
|
||||
@internationalizeDocstring
|
||||
class %s(callbacks.Plugin):
|
||||
"""Add the help for "@plugin help %s" here
|
||||
This should describe *how* to use this plugin."""
|
||||
@ -125,13 +122,11 @@ import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
from supybot.i18n import internationalizeDocstring
|
||||
_ = PluginInternationalization('%s')
|
||||
except:
|
||||
# These are useless functions that's allow to run the plugin on a bot
|
||||
# without the i18n plugin
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
_ = lambda x:x
|
||||
internationalizeDocstring = lambda x:x
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
|
@ -1039,6 +1039,8 @@ class Spec(object):
|
||||
return state
|
||||
|
||||
def _wrap(f, specList=[], name=None, **kw):
|
||||
assert hasattr(f, '__doc__')
|
||||
f = internationalizeDocstring(f)
|
||||
name = name or f.func_name
|
||||
spec = Spec(specList, **kw)
|
||||
def newf(self, irc, msg, args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user