#NEWLINE# def requires_auth( self , func ) : #NEWLINE# #INDENT# "\n        Decorator to prompt for user name and password. Useful for data dumps,\n        etc.  That you don't want to be public.\n        " #NEWLINE# @ wraps ( func ) #NEWLINE# def decorated( * args , **kwargs ) : #NEWLINE# #INDENT# ' Wrapper ' #NEWLINE# auth = request . authorization #NEWLINE# if ( ( not auth ) or ( not self . check_auth ( auth . username , auth . password ) ) ) : #NEWLINE# #INDENT# return self . authenticate ( ) #NEWLINE# #UNINDENT# return func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# return self