#NEWLINE# def route( self , source , destination , avoidance_list , size_restriction , ignore_eol , ignore_masscrit , age_threshold ) : #NEWLINE# #INDENT# source_id = self . eve_db . name2id ( source ) #NEWLINE# dest_id = self . eve_db . name2id ( destination ) #NEWLINE# path = self . solar_map . shortest_path ( source_id , dest_id , [ self . eve_db . name2id ( x ) for x in avoidance_list ] , size_restriction , ignore_eol , ignore_masscrit , age_threshold ) #NEWLINE# route = [ ] #NEWLINE# short_format = '' #NEWLINE# prev_gate = None #NEWLINE# for ( idx , x ) in enumerate ( path ) : #NEWLINE# #INDENT# if ( idx < ( len ( path ) - 1 ) ) : #NEWLINE# #INDENT# source = self . solar_map . get_system ( x ) #NEWLINE# dest = self . solar_map . get_system ( path [ ( idx + 1 ) ] ) #NEWLINE# weight = source . get_weight ( dest ) #NEWLINE# weight_back = dest . get_weight ( source ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# weight = None #NEWLINE# weight_back = None #NEWLINE# #UNINDENT# system_description = list ( self . eve_db . system_desc [ x ] ) #NEWLINE# system_description . append ( Navigation . _get_instructions ( weight ) ) #NEWLINE# system_description . append ( Navigation . _get_additional_info ( weight , weight_back ) ) #NEWLINE# route . append ( system_description ) #NEWLINE# if ( not weight ) : #NEWLINE# #INDENT# if prev_gate : #NEWLINE# #INDENT# if ( prev_gate != path [ ( idx - 1 ) ] ) : #NEWLINE# #INDENT# short_format += '...-->' #NEWLINE# #UNINDENT# #UNINDENT# short_format += system_description [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( weight [ 0 ] == SolarMap . WORMHOLE ) : #NEWLINE# #INDENT# if prev_gate : #NEWLINE# #INDENT# if ( prev_gate != path [ ( idx - 1 ) ] ) : #NEWLINE# #INDENT# short_format += '...-->' #NEWLINE# #UNINDENT# #UNINDENT# [ wh_sig , _ , _ , _ , _ , _ ] = weight [ 1 ] #NEWLINE# short_format += ( system_description [ 0 ] + '[{}]~~>' . format ( wh_sig ) ) #NEWLINE# prev_gate = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( weight [ 0 ] == SolarMap . GATE ) : #NEWLINE# #INDENT# if ( not prev_gate ) : #NEWLINE# #INDENT# short_format += ( system_description [ 0 ] + '-->' ) #NEWLINE# prev_gate = path [ idx ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# short_format += 'Where am I?-->' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return [ route , short_format ]