From a54b155f31445fd669fd82e01a5d80dcb27e3734 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Wed, 13 Feb 2019 12:18:20 -0500 Subject: [PATCH] make python3 compatible --- config.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/config.py b/config.py index d9f1056..0cad209 100644 --- a/config.py +++ b/config.py @@ -4,9 +4,13 @@ import supybot.conf as conf import supybot.registry as registry -import os -#The plugin name will be based on the plugin's folder. -PluginName=os.path.dirname( __file__ ).split(os.sep)[-1] +try: + from supybot.i18n import PluginInternationalization + _ = PluginInternationalization('Uno') +except: + # Placeholder that allows to run the plugin on a bot + # without the i18n module + _ = lambda x: x def configure(advanced): # This will be called by supybot to configure this module. advanced is @@ -14,9 +18,8 @@ def configure(advanced): # user or not. You should effect your configuration by manipulating the # registry as appropriate. from supybot.questions import expect, anything, something, yn - conf.registerPlugin(PluginName, True) + conf.registerPlugin('Uno', True) -P = conf.registerPlugin(PluginName) -P.__name__ = PluginName +Uno = conf.registerPlugin('Uno') # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: