#NEWLINE# def _PreprocessManualFacets( self ) : #NEWLINE# #INDENT# 'Create a map for manual facets to be accessed easier by name later.' #NEWLINE# self . _manual_facets = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _manual_facet_map = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for manual_facet in self . _params . include_facet_list ( ) : #NEWLINE# #INDENT# self . _manual_facet_map [ manual_facet . name ( ) ] = manual_facet . params ( ) #NEWLINE# if ( manual_facet . params ( ) . range_list ( ) and manual_facet . params ( ) . value_constraint_list ( ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Manual facet request should either specify range or value constraint, not both' ) #NEWLINE# #UNINDENT# facet_obj = _Facet ( manual_facet . name ( ) , ( manual_facet . params ( ) . value_limit ( ) if manual_facet . params ( ) . has_value_limit ( ) else self . _params . facet_auto_detect_param ( ) . value_limit ( ) ) ) #NEWLINE# self . _manual_facets [ manual_facet . name ( ) ] = value #NEWLINE# for value in manual_facet . params ( ) . value_constraint_list ( ) : #NEWLINE# #INDENT# facet_obj . AddValue ( value , 0 ) #NEWLINE# #UNINDENT# for range_request in manual_facet . params ( ) . range_list ( ) : #NEWLINE# #INDENT# range_pair = ( ( float ( range_request . start ( ) ) if range_request . has_start ( ) else None ) , ( float ( range_request . end ( ) ) if range_request . has_end ( ) else None ) ) #NEWLINE# facet_obj . AddValue ( self . _GetFacetLabel ( range_request ) , 0 , refinement = range_pair )