-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aewebb80
committed
Oct 18, 2019
1 parent
0631083
commit 8a01bf5
Showing
12 changed files
with
210 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import os | ||
import logging | ||
|
||
def local_executable (executable): | ||
|
||
return os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'bin', executable) | ||
|
||
def confirm_executable (executable): | ||
|
||
''' | ||
Confirm if an executable exists. | ||
Parameters | ||
---------- | ||
executable : str | ||
Executable to confirm | ||
''' | ||
|
||
# Loop potental locations of executables | ||
for path in os.environ['PATH'].split(os.pathsep): | ||
|
||
# Join current path and executable | ||
executable_file = os.path.join(path, executable) | ||
|
||
# Check if the executable path exists, and if so, is an executable | ||
if os.path.isfile(executable_file) and os.access(executable_file, os.X_OK): | ||
|
||
logging.info('Calling executable: %s' % executable_file) | ||
|
||
# Return the path if the executable was found | ||
return executable_file | ||
|
||
# Return None if the executable was not found | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.