def action_hooks(context, hook_cls, action_key=u'action', template_name=u'extensions/action.html'):
 s = u''
 for hook in hook_cls.hooks:
  try:
   for actions in hook.get_actions(context):
    if actions:
     context.push()
     context[action_key] = actions
     try:
      s += render_to_string(template_name, context)
     except Exception as e:
      logging.error(u'Error when rendering template for action "%s" for hook %r in extension "%s": %s', action_key, hook, hook.extension.id, e, exc_info=1)
     context.pop()
  except Exception as e:
   logging.error(u'Error when running get_actions() on hook %r in extension "%s": %s', hook, hook.extension.id, e, exc_info=1)
 return s

def action_hooks ( context , hook_cls , action_key = u'action' , template_name = u'extensions/action.html' ) : s = u'' for hook in hook_cls . hooks : try : for actions in hook . get_actions ( context ) : if actions : context . push ( ) context [ action_key ] = actions try : s += render_to_string ( template_name , context ) except Exception as e : logging . error ( u'Error when rendering template for action "%s" for hook %r in extension "%s": %s' , action_key , hook , hook . extension . id , e , exc_info = 1 ) context . pop ( ) except Exception as e : logging . error ( u'Error when running get_actions() on hook %r in extension "%s": %s' , hook , hook . extension . id , e , exc_info = 1 ) return s
displays all registered action hooks from the specified actionhook .