Time: fix compatibility with Supybots that have not i18n
parent
7bb5acc6f4
commit
6851517d90
|
@ -29,8 +29,16 @@
|
|||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Time')
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
from supybot.i18n import internationalizeDocstring
|
||||
_ = PluginInternationalization('Time')
|
||||
except:
|
||||
# This are useless functions that's allow to run the plugin on a bot
|
||||
# without the i18n plugin
|
||||
_ = lambda x:x
|
||||
internationalizeDocstring = lambda x:x
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
|
|
|
@ -35,8 +35,15 @@ import supybot.conf as conf
|
|||
import supybot.utils as utils
|
||||
from supybot.commands import *
|
||||
import supybot.callbacks as callbacks
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Time')
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
from supybot.i18n import internationalizeDocstring
|
||||
_ = PluginInternationalization('Time')
|
||||
except:
|
||||
# This are useless functions that's allow to run the plugin on a bot
|
||||
# without the i18n plugin
|
||||
_ = lambda x:x
|
||||
internationalizeDocstring = lambda x:x
|
||||
|
||||
parser = utils.python.universalImport('dateutil.parser', 'local.dateutil.parser')
|
||||
|
||||
|
|
Loading…
Reference in New Issue