Executables now have a useful __str__ function.

This commit is contained in:
Todd Gamblin 2015-06-06 16:15:34 -07:00
parent 53feb12ea0
commit eb9859ce75

View file

@ -124,6 +124,11 @@ def __repr__(self):
return "<exe: %s>" % self.exe return "<exe: %s>" % self.exe
def __str__(self):
return ' '.join(self.exe)
def which(name, **kwargs): def which(name, **kwargs):
"""Finds an executable in the path like command-line which.""" """Finds an executable in the path like command-line which."""
path = kwargs.get('path', os.environ.get('PATH', '').split(os.pathsep)) path = kwargs.get('path', os.environ.get('PATH', '').split(os.pathsep))