From ad3deb7c21ba156f5c19da32fa642de6a31605ad Mon Sep 17 00:00:00 2001 From: Sergio Conde Date: Tue, 1 Apr 2014 20:16:20 +0200 Subject: [PATCH 1/6] Fix AttributeError exception in log.py with python3.4 --- src/log.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/log.py b/src/log.py index b5425e4e9..63abafeba 100644 --- a/src/log.py +++ b/src/log.py @@ -209,7 +209,10 @@ class ValidLogLevel(registry.String): def set(self, s): s = s.upper() try: - level = logging._levelNames[s] + try: + level = logging._levelNames[s] + except AttributeError: + level = logging._nameToLevel[s] except KeyError: try: level = int(s) From 048c1e77f43f4b6c09103ba3bfe7ed314621dda2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 2 Apr 2014 17:18:20 +0000 Subject: [PATCH 2/6] httpserver: Fix favicon handling. --- src/httpserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/httpserver.py b/src/httpserver.py index b07d25e03..6eb81618c 100644 --- a/src/httpserver.py +++ b/src/httpserver.py @@ -361,15 +361,15 @@ class Favicon(SupyHTTPServerCallback): file_path = conf.supybot.servers.http.favicon() found = False if file_path: + response = None try: icon = open(file_path, 'r') - found = True + response = icon.read() except IOError: pass finally: icon.close() - if found: - response = icon.read() + if response is not None: filename = file_path.rsplit(os.sep, 1)[1] if '.' in filename: ext = filename.rsplit('.', 1)[1] From 4d9a8a1408c6cbcb17b9f6892cad35d6fe03d3f8 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 2 Apr 2014 17:34:04 +0000 Subject: [PATCH 3/6] httpserver: Open icon in binary mode. --- src/httpserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/httpserver.py b/src/httpserver.py index 6eb81618c..688349417 100644 --- a/src/httpserver.py +++ b/src/httpserver.py @@ -363,7 +363,7 @@ class Favicon(SupyHTTPServerCallback): if file_path: response = None try: - icon = open(file_path, 'r') + icon = open(file_path, 'rb') response = icon.read() except IOError: pass From 36568aa849fa03eb45dd69614cee7c2a3a1d05c8 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 3 Apr 2014 11:47:24 +0000 Subject: [PATCH 4/6] Config: Also tell about current channel value in @help if it is different from the global one. Closes GH-581. --- plugins/Config/plugin.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index d7fa3e435..128731ad6 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -239,7 +239,18 @@ class Config(callbacks.Plugin): s = group.help() if s: if hasattr(group, 'value') and not group._private: - s += _(' (Current value: %s)') % group + channel = msg.args[0] + if irc.isChannel(channel): + globvalue = str(group) + chanvalue = str(group.get(channel)) + if chanvalue != globvalue: + s += _(' (Current global value: %s; ' + 'current channel value: %s)') % \ + (globvalue, chanvalue) + else: + s += _(' (Current value: %s)') % group + else: + s += _(' (Current value: %s)') % group irc.reply(s) else: irc.reply(_('That configuration group exists, but seems to ' From de1c01f47b9daec7ba303de5c52b4b7c2f1b3367 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 3 Apr 2014 11:51:13 +0000 Subject: [PATCH 5/6] Fix previous commit for config variables that are not channel-specific. --- plugins/Config/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index 128731ad6..f065474d2 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -240,7 +240,8 @@ class Config(callbacks.Plugin): if s: if hasattr(group, 'value') and not group._private: channel = msg.args[0] - if irc.isChannel(channel): + if irc.isChannel(channel) and \ + channel in group._children: globvalue = str(group) chanvalue = str(group.get(channel)) if chanvalue != globvalue: From 3bb183cf6d1261916347ff94712032e027ce8248 Mon Sep 17 00:00:00 2001 From: Ken Spencer Date: Thu, 3 Apr 2014 12:01:41 -0400 Subject: [PATCH 6/6] Add my own repo (IotaSpencer --- plugins/PluginDownloader/plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/PluginDownloader/plugin.py b/plugins/PluginDownloader/plugin.py index b2232146b..be3beb57a 100644 --- a/plugins/PluginDownloader/plugin.py +++ b/plugins/PluginDownloader/plugin.py @@ -297,6 +297,10 @@ repositories = { 'GLolol', 'SupyPlugins', ), + 'Iota': GithubRepository( + 'IotaSpencer', + 'supyplugins', + ), } class PluginDownloader(callbacks.Plugin):