def _get_widget(request, module, widget_name):
 import_name = (module.name + '.widgets')
 module_widget_lib = __import__(import_name, fromlist=[str(module.name)])
 module_widgets = module_widget_lib.get_widgets(request)
 widget = {}
 for name in module_widgets:
  if (name == widget_name):
   widget = module_widgets[name]
   if ('module_name' not in widget):
    widget['module_name'] = module.name
   if ('module_title' not in widget):
    widget['module_title'] = module.title
   widget = _preprocess_widget(widget, widget_name)
   break
 return widget

def _get_widget ( request , module , widget_name ) : import_name = ( module . name + '.widgets' ) module_widget_lib = __import__ ( import_name , fromlist = [ str ( module . name ) ] ) module_widgets = module_widget_lib . get_widgets ( request ) widget = { } for name in module_widgets : if ( name == widget_name ) : widget = module_widgets [ name ] if ( 'module_name' not in widget ) : widget [ 'module_name' ] = module . name if ( 'module_title' not in widget ) : widget [ 'module_title' ] = module . title widget = _preprocess_widget ( widget , widget_name ) break return widget
gets a widget by name .