allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [47/50] [abbrv] allura git commit: [#7887] ticket:790 Handle unique entry points in allura.* subgroup
Date Fri, 05 Jun 2015 18:42:02 GMT
[#7887] ticket:790 Handle unique entry points in allura.* subgroup


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1d9daf4a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1d9daf4a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1d9daf4a

Branch: refs/heads/hs/7873
Commit: 1d9daf4af19e66e99209b572a45615bb9d47b70e
Parents: 109906d
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Jun 4 10:35:49 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Thu Jun 4 10:35:49 2015 +0000

----------------------------------------------------------------------
 Allura/allura/lib/helpers.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/1d9daf4a/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 76e8db3..396d7d6 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1068,15 +1068,15 @@ def plain2markdown(text, preserve_multiple_spaces=False, has_html_entities=False
 def iter_entry_points(group, *a, **kw):
     """Yields entry points that have not been disabled in the config.
 
-    If ``group`` is "allura" (Allura tool entry points), this function also
-    checks for multiple entry points with the same name. If there are
-    multiple entry points with the same name, and one of them is a subclass
-    of the other(s), it will be yielded, and the other entry points with that
-    name will be ignored. If a subclass is not found, an ImportError will be
-    raised.
+    If ``group`` is "allura" (Allura tool entry points) or one of subgroups
+    (e.g. "allura.phone"), this function also checks for multiple entry points
+    with the same name. If there are multiple entry points with the same name,
+    and one of them is a subclass of the other(s), it will be yielded, and the
+    other entry points with that name will be ignored. If a subclass is not
+    found, an ImportError will be raised.
 
-    This treatment of "allura" entry points allows tool authors to subclass
-    another tool while reusing the original entry point name.
+    This treatment of "allura" and "allura.*" entry points allows tool authors
+    to subclass another tool while reusing the original entry point name.
 
     """
     def active_eps():
@@ -1105,7 +1105,8 @@ def iter_entry_points(group, *a, **kw):
                 return ep
         raise ImportError('Ambiguous [allura] entry points detected. ' +
                           'Multiple entry points with name "%s".' % entry_points[0].name)
-    return iter(unique_eps(active_eps()) if group == 'allura' else active_eps())
+    is_allura = group == 'allura' or group.startswith('allura.')
+    return iter(unique_eps(active_eps()) if is_allura else active_eps())
 
 
 # http://stackoverflow.com/a/1060330/79697


Mime
View raw message