@register.function
@jinja2.contextfunction
def remora_url(context, url, lang=None, app=None, prefix=''):
 if (lang is None):
  _lang = context['LANG']
  if _lang:
   lang = to_locale(_lang).replace('_', '-')
 if (app is None):
  try:
   app = context['APP'].short
  except (AttributeError, KeyError):
   pass
 return urlresolvers.remora_url(url=url, lang=lang, app=app, prefix=prefix)

@ register . function @ jinja2 . contextfunction def remora_url ( context , url , lang = None , app = None , prefix = '' ) : if ( lang is None ) : _lang = context [ 'LANG' ] if _lang : lang = to_locale ( _lang ) . replace ( '_' , '-' ) if ( app is None ) : try : app = context [ 'APP' ] . short except ( AttributeError , KeyError ) : pass return urlresolvers . remora_url ( url = url , lang = lang , app = app , prefix = prefix )
wrapper for urlresolvers .