#NEWLINE# def find_ssh_executable( name = 'ssh' ) : #NEWLINE# #INDENT# exts = os . environ . get ( 'PATHEXT' , '' ) . split ( os . pathsep ) #NEWLINE# dirs = list ( os . environ . get ( 'PATH' , '' ) . split ( os . pathsep ) ) #NEWLINE# ( par , join ) = ( os . path . dirname , os . path . join ) #NEWLINE# loc = par ( sys . executable ) #NEWLINE# local_dirs = [ ] #NEWLINE# for i in irange ( 3 ) : #NEWLINE# #INDENT# local_dirs . extend ( [ loc , join ( loc , 'ssh' ) ] ) #NEWLINE# loc = par ( loc ) #NEWLINE# #UNINDENT# for pathdir in ( local_dirs + dirs ) : #NEWLINE# #INDENT# for ext in exts : #NEWLINE# #INDENT# fullpath = os . path . join ( pathdir , ( name + ext ) ) #NEWLINE# if os . path . isfile ( fullpath ) : #NEWLINE# #INDENT# return fullpath #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return None