diff 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
line wrap: on
line diff
--- a/Tests/Toolbox.py	Tue Aug 25 13:02:43 2015 +0200
+++ b/Tests/Toolbox.py	Thu Aug 27 11:57:16 2015 +0200
@@ -199,6 +199,16 @@
     else:
         return m.groups()[0]
 
+def FindExecutable(name):
+    p = os.path.join('/usr/local/bin', name)
+    if os.path.isfile(p):
+        return p
+
+    p = os.path.join('/usr/local/sbin', name)
+    if os.path.isfile(p):
+        return p
+
+    return name