From 853d29a0f12cdcb6c406b829a57439c7ea9b570d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 14 Jul 2011 20:59:01 +0200 Subject: has_key refractored, package name generator by Geek --- module/Api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module/Api.py') diff --git a/module/Api.py b/module/Api.py index ffb88c6af..fd65dff92 100644 --- a/module/Api.py +++ b/module/Api.py @@ -64,7 +64,7 @@ class Api(Iface): items.append(item) section.items = items sections[sectionName] = section - if sub.has_key("outline"): + if "outline" in sub: section.outline = sub["outline"] return sections @@ -90,7 +90,6 @@ class Api(Iface): :param section: 'plugin' or 'core """ self.core.hookManager.dispatchEvent("configChanged", category, option, value, section) - print category, option, value, section if section == "core": self.core.config[category][option] = value @@ -727,7 +726,7 @@ class Api(Iface): :return: bool """ cont = self.core.hookManager.methods - return cont.has_key(plugin) and cont[plugin].has_key(func) + return plugin in cont and func in cont[plugin] def call(self, info): """Calls a service (a method in hook plugin). @@ -765,7 +764,7 @@ class Api(Iface): :return: dict of attr names mapped to value {"name": value} """ info = self.core.hookManager.getAllInfo() - if info.has_key(plugin): + if plugin in info: return info[plugin] else: return {} -- cgit v1.2.3