#NEWLINE# def jsonp( func ) : #NEWLINE# #INDENT# 'Wraps JSONified output for JSONP requests.' #NEWLINE# @ wraps ( func ) #NEWLINE# def decorated( * args , **kwargs ) : #NEWLINE# #INDENT# callback = request . args . get ( 'callback' , False ) #NEWLINE# if callback : #NEWLINE# #INDENT# data = str ( func ( * args , ** kwargs ) . data ) #NEWLINE# content = ( ( ( str ( callback ) + '(' ) + data ) + ')' ) #NEWLINE# mimetype = 'application/javascript' #NEWLINE# return current_app . response_class ( content , mimetype = mimetype ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# return func