#NEWLINE# def cat_update( request , cat_id ) : #NEWLINE# #INDENT# 'Update an existing category.' #NEWLINE# form = request . form #NEWLINE# sig = form . get ( 'categorySignature' , None ) #NEWLINE# human = form . get ( 'humanName' , None ) #NEWLINE# thresh = form . get ( 'categoryThreshold' , None ) #NEWLINE# cat = category . Category ( REDIS , cat_id = cat_id ) #NEWLINE# if ( sig and ( cat . signature is not sig ) ) : #NEWLINE# #INDENT# cat . signature = sig #NEWLINE# #UNINDENT# if ( thresh and ( cat . threshold is not thresh ) ) : #NEWLINE# #INDENT# cat . _set_threshold ( thresh ) #NEWLINE# #UNINDENT# if ( form and ( cat . human_name is not human ) ) : #NEWLINE# #INDENT# cat . _set_human ( human ) #NEWLINE# #UNINDENT# return render_template ( 'category.html' , cat_id = cat_id , ** cat . to_dict ( ) )