def _get_all_widgets(request):
 user = request.user.profile
 perspective = user.get_perspective()
 modules = perspective.get_modules()
 widgets = {}
 for module in modules:
  try:
   import_name = (module.name + '.widgets')
   module_widget_lib = __import__(import_name, fromlist=[str(module.name)])
   module_widgets = module_widget_lib.get_widgets(request)
   for name in module_widgets:
    if ('module_name' not in module_widgets[name]):
     module_widgets[name]['module_name'] = module.name
    if ('module_title' not in module_widgets[name]):
     module_widgets[name]['module_title'] = module.title
    module_widgets[name] = _preprocess_widget(module_widgets[name], name)
   widgets.update(module_widgets)
  except ImportError:
   pass
  except AttributeError:
   pass
 return widgets

def _get_all_widgets ( request ) : user = request . user . profile perspective = user . get_perspective ( ) modules = perspective . get_modules ( ) widgets = { } for module in modules : try : import_name = ( module . name + '.widgets' ) module_widget_lib = __import__ ( import_name , fromlist = [ str ( module . name ) ] ) module_widgets = module_widget_lib . get_widgets ( request ) for name in module_widgets : if ( 'module_name' not in module_widgets [ name ] ) : module_widgets [ name ] [ 'module_name' ] = module . name if ( 'module_title' not in module_widgets [ name ] ) : module_widgets [ name ] [ 'module_title' ] = module . title module_widgets [ name ] = _preprocess_widget ( module_widgets [ name ] , name ) widgets . update ( module_widgets ) except ImportError : pass except AttributeError : pass return widgets
retrieve widgets from all available modules .