#NEWLINE# def Save( self , cron_flow ) : #NEWLINE# #INDENT# 'Generate a histogram object and store in the specified attribute.' #NEWLINE# histograms = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for active_time in self . active_days : #NEWLINE# #INDENT# for label in self . categories [ active_time ] . keys ( ) : #NEWLINE# #INDENT# histograms . setdefault ( label , self . attribute ( ) ) #NEWLINE# graph = rdfstats . Graph ( title = ( '%s day actives for %s label' % ( active_time , label ) ) ) #NEWLINE# for ( k , v ) in sorted ( self . categories [ active_time ] [ label ] . items ( ) ) : #NEWLINE# #INDENT# graph . Append ( label = k , y_value = v ) #NEWLINE# #UNINDENT# histograms [ label ] . Append ( graph ) #NEWLINE# #UNINDENT# #UNINDENT# for ( label , histogram ) in histograms . items ( ) : #NEWLINE# #INDENT# cron_flow . _StatsForLabel ( label ) . AddAttribute ( histogram )