def render_genshi_tmpl(tmplstr, context, tmplpath=None):
 method = context.get('method', 'xml')
 if ((method == 'text') or (method == 'newtext')):
  from genshi.template import NewTextTemplate
  tmpl = NewTextTemplate(tmplstr)
 elif (method == 'oldtext'):
  from genshi.template import OldTextTemplate
  tmpl = OldTextTemplate(tmplstr)
 else:
  from genshi.template import MarkupTemplate
  tmpl = MarkupTemplate(tmplstr)
 return tmpl.generate(**context).render(method)

def render_genshi_tmpl ( tmplstr , context , tmplpath = None ) : method = context . get ( 'method' , 'xml' ) if ( ( method == 'text' ) or ( method == 'newtext' ) ) : from genshi . template import NewTextTemplate tmpl = NewTextTemplate ( tmplstr ) elif ( method == 'oldtext' ) : from genshi . template import OldTextTemplate tmpl = OldTextTemplate ( tmplstr ) else : from genshi . template import MarkupTemplate tmpl = MarkupTemplate ( tmplstr ) return tmpl . generate ( ** context ) . render ( method )
render a genshi template .