INNER CODE UNIT · Python
PrexistingUnixCommand
broadinstitute/viral-ngs · src/viral_ngs/core/__init__.py:146
class PrexistingUnixCommand(InstallMethod):
''' This is an install method that tries to find whether an executable
binary already exists for free on the unix file system--it doesn't
actually try to install anything.
'''
def __init__(self, path, verifycmd=None, verifycode=0, require_executability=True):
self.path = path
self.verifycmd = verifycmd
self.verifycode = verifycode
self.installed = False
self.require_executability = require_executability
InstallMethod.__init__(self)
def _attempt_install(self):
if os.access(self.path, (os.X_OK | os.R_OK) if self.require_executability else os.R_OK):
if self.verifycmd:
self.installed = (os.system(self.verifycmd) == self.verifycode)