[conduit/tracker] Support tralchemy nested inside other modules (eww)
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit/tracker] Support tralchemy nested inside other modules (eww)
- Date: Fri, 3 Jul 2009 14:17:09 +0000 (UTC)
commit 168e2deea75babf76265ddf6101ba5ca7533b60d
Author: John Carr <john carr unrouted co uk>
Date: Fri Jul 3 14:38:21 2009 +0100
Support tralchemy nested inside other modules (eww)
.../modules/TrackerModule/tralchemy/namespace.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/conduit/modules/TrackerModule/tralchemy/namespace.py b/conduit/modules/TrackerModule/tralchemy/namespace.py
index b0c181d..9bb7f3f 100644
--- a/conduit/modules/TrackerModule/tralchemy/namespace.py
+++ b/conduit/modules/TrackerModule/tralchemy/namespace.py
@@ -78,19 +78,19 @@ class NamespaceFinder(object):
def find_module(name, path=None):
names = name.split(".")
- # We only support imports of tralchemy.<namespace_name>
- if len(names) != 2 or names[0] != "tralchemy":
+ # We only support imports of [foo.]tralchemy.namespace_name
+ if len(names) < 2 or names[-2] != "tralchemy":
return None
# To avoid pain misery and suffering, don't do anything clever for
# our interals..
- if names[1] in ("core", "namespace"):
+ if names[-1] in ("core", "namespace"):
return None
- if not names[1] in namespaces.values():
+ if not names[-1] in namespaces.values():
return None
- return NamespaceLoader(names[1], path)
+ return NamespaceLoader(names[-1], path)
class NamespaceLoader(object):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]