comparison Tests/Toolbox.py @ 44:ffa542cce638

Toolbox.FindExecutable()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Aug 2015 11:57:16 +0200
parents 156c7ae164b5
children 84378ada15ab
comparison
equal deleted inserted replaced
43:5f3bcdde2461 44:ffa542cce638
197 if m == None: 197 if m == None:
198 return 'localhost' 198 return 'localhost'
199 else: 199 else:
200 return m.groups()[0] 200 return m.groups()[0]
201 201
202 def FindExecutable(name):
203 p = os.path.join('/usr/local/bin', name)
204 if os.path.isfile(p):
205 return p
206
207 p = os.path.join('/usr/local/sbin', name)
208 if os.path.isfile(p):
209 return p
210
211 return name
202 212
203 213
204 214
205 class ExternalCommandThread: 215 class ExternalCommandThread:
206 @staticmethod 216 @staticmethod