#NEWLINE# def create_filter_callable( self , args , target , is_expression ) : #NEWLINE# #INDENT# "write a filter-applying expression based on the filters\n        present in the given filter names, adjusting for the global\n        'default' filter aliases as needed." #NEWLINE# def locate_encode( name ) : #NEWLINE# #INDENT# if re . match ( 'decode\\..+' , name ) : #NEWLINE# #INDENT# return ( 'filters.' + name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . compiler . disable_unicode : #NEWLINE# #INDENT# return filters . NON_UNICODE_ESCAPES . get ( name , name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return filters . DEFAULT_ESCAPES . get ( name , name ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( 'n' not in args ) : #NEWLINE# #INDENT# if is_expression : #NEWLINE# #INDENT# if self . compiler . pagetag : #NEWLINE# #INDENT# args = ( self . compiler . pagetag . filter_args . args + args ) #NEWLINE# #UNINDENT# if self . compiler . default_filters : #NEWLINE# #INDENT# args = ( self . compiler . default_filters + args ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for e in args : #NEWLINE# #INDENT# if ( e == 'n' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# m = re . match ( '(.+?)(\\(.*\\))' , e ) #NEWLINE# if m : #NEWLINE# #INDENT# ( ident , fargs ) = m . group ( 1 , 2 ) #NEWLINE# f = locate_encode ( ident ) #NEWLINE# e = ( f + fargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# x = e #NEWLINE# e = locate_encode ( e ) #NEWLINE# assert ( e is not None ) #NEWLINE# #UNINDENT# target = ( '%s(%s)' % ( e , target ) ) #NEWLINE# #UNINDENT# return target