def _preprocess_widget(widget, name):
 module_name = widget['module_name']
 import_name = (module_name + '.views')
 module_views = __import__(import_name, fromlist=[str(module_name)])
 if hasattr(module_views, name):
  if ('title' not in widget):
   widget['title'] = getattr(module_views, name).__doc__
  widget = copy.deepcopy(widget)
  if ('view' not in widget):
   widget['view'] = getattr(module_views, name)
 return widget

def _preprocess_widget ( widget , name ) : module_name = widget [ 'module_name' ] import_name = ( module_name + '.views' ) module_views = __import__ ( import_name , fromlist = [ str ( module_name ) ] ) if hasattr ( module_views , name ) : if ( 'title' not in widget ) : widget [ 'title' ] = getattr ( module_views , name ) . __doc__ widget = copy . deepcopy ( widget ) if ( 'view' not in widget ) : widget [ 'view' ] = getattr ( module_views , name ) return widget
populates widget with missing fields .