#NEWLINE# def _make_path( prg ) : #NEWLINE# #INDENT# parts = prg . split ( '/' ) #NEWLINE# env = os . environ . get ( 'EXABGP_ETC' , '' ) #NEWLINE# if env : #NEWLINE# #INDENT# options = [ os . path . join ( env . rstrip ( '/' ) , * os . path . join ( parts [ 2 : ] ) ) , '/etc/exabgp' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# options = [ ] #NEWLINE# options . append ( '/etc/exabgp' ) #NEWLINE# pwd = os . environ . get ( 'PWD' , '' ) . split ( '/' ) #NEWLINE# if pwd : #NEWLINE# #INDENT# if ( pwd [ ( - 1 ) ] in ( 'etc' , 'sbin' ) ) : #NEWLINE# #INDENT# options . append ( os . path . abspath ( os . path . join ( os . path . join ( * pwd [ : ( - 1 ) ] ) , os . path . join ( * parts ) ) ) ) #NEWLINE# #UNINDENT# if ( 'etc' not in pwd ) : #NEWLINE# #INDENT# options . append ( os . path . abspath ( os . path . join ( os . path . join ( * pwd ) , os . path . join ( * parts ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return options