#NEWLINE# def moderate( self , environ , request , id , action , key ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# id = self . isso . unsign ( key , max_age = ( 2 ** 32 ) ) #NEWLINE# #UNINDENT# except ( BadSignature , SignatureExpired ) : #NEWLINE# #INDENT# raise Forbidden #NEWLINE# #UNINDENT# item = self . comments . get ( id ) #NEWLINE# if ( item is None ) : #NEWLINE# #INDENT# raise NotFound #NEWLINE# #UNINDENT# if ( request . method == 'GET' ) : #NEWLINE# #INDENT# modal = ( "<!DOCTYPE html><html><head><script>  if (confirm('%s: Are you sure?')) {      xhr = new XMLHttpRequest;      xhr.open('POST', window.location.href);      xhr.send(null);  }</script>" % action . capitalize ( ) ) #NEWLINE# return Response ( modal , 200 , content_type = 'text/html' ) #NEWLINE# #UNINDENT# if ( action == 'activate' ) : #NEWLINE# #INDENT# with self . isso . lock : #NEWLINE# #INDENT# self . comments . activate ( id ) #NEWLINE# #UNINDENT# self . signal ( 'comments.activate' , id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with self . isso . lock : #NEWLINE# #INDENT# self . comments . delete ( id ) #NEWLINE# #UNINDENT# self . cache . delete ( 'hash' , ( item [ 'email' ] or item [ 'remote_addr' ] ) . encode ( 'utf-8' ) ) #NEWLINE# self . signal ( 'comments.delete' , id ) #NEWLINE# #UNINDENT# return Response ( 'Yo' , 200 )