#NEWLINE# def post( self ) : #NEWLINE# #INDENT# namespace = self . request . get ( 'namespace' ) #NEWLINE# period_type = self . request . get ( 'period_type' ) #NEWLINE# period = self . request . get ( 'period' ) #NEWLINE# name = self . request . get ( 'name' ) #NEWLINE# full_key = LivecountCounter . KeyName ( namespace , period_type , period , name ) #NEWLINE# partial_key = LivecountCounter . PartialKeyName ( period_type , period , name ) #NEWLINE# memcache . delete ( ( partial_key + '_dirty' ) , namespace = namespace ) #NEWLINE# cached_count = memcache . get ( partial_key , namespace = namespace ) #NEWLINE# if ( cached_count is None ) : #NEWLINE# #INDENT# logging . error ( 'LivecountCounterWorker: Failure for partial key=%s' , partial_key ) #NEWLINE# return #NEWLINE# #UNINDENT# scoped_period = PeriodType . find_scope ( period_type , partial_key ) #NEWLINE# LivecountCounter ( key_name = full_key , namespace = namespace , period_type = period_type , period = scoped_period , name = name , count = cached_count ) . put ( )