def get_view_config(context, global_type=False):
 request = context.get(u'request')
 config_key = (u'_xtheme_global_view_config' if global_type else u'_xtheme_view_config')
 config = context.vars.get(config_key)
 if (config is None):
  view_object = context.get(u'view')
  if view_object:
   view_class = view_object.__class__
   view_name = view_class.__name__
  else:
   view_name = u'UnknownView'
  config = ViewConfig(theme=get_current_theme(request), view_name=view_name, draft=is_edit_mode(request), global_type=global_type)
  context.vars[config_key] = config
 return config

def get_view_config ( context , global_type = False ) : request = context . get ( u'request' ) config_key = ( u'_xtheme_global_view_config' if global_type else u'_xtheme_view_config' ) config = context . vars . get ( config_key ) if ( config is None ) : view_object = context . get ( u'view' ) if view_object : view_class = view_object . __class__ view_name = view_class . __name__ else : view_name = u'UnknownView' config = ViewConfig ( theme = get_current_theme ( request ) , view_name = view_name , draft = is_edit_mode ( request ) , global_type = global_type ) context . vars [ config_key ] = config return config
get a view configuration object for a jinja2 rendering context .