moksha/__init__.py | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 928f5b69fb24bb4489518c330e9fca9e59eb71d1
Author: Luke Macken <luke(a)civx.us>
Date: Sun Jun 20 23:13:05 2010 -0400
Add a moksha.get_widgets() method
diff --git a/moksha/__init__.py b/moksha/__init__.py
index 91ec102..efda46c 100644
--- a/moksha/__init__.py
+++ b/moksha/__init__.py
@@ -44,6 +44,11 @@ def get_widget(name):
if _widgets:
return _widgets[name]['widget']
+def get_widgets():
+ """ Return a dictionary of all widgets """
+ from pkg_resources import iter_entry_points
+ return _widgets or [widget.load() for widget in
iter_entry_points('moksha.widget')]
+
def get_app(name):
""" Get an app controller by name """
return _apps[name]['controller']
Show replies by date