Mercurial > hg > stampit
annotate stampit/utils.py @ 5:3f9fac577d75
this now actually makes some tarballs for you
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 20 Apr 2010 14:51:47 -0700 |
parents | 6ef0e769248d |
children |
rev | line source |
---|---|
3 | 1 """ |
2 utility functions | |
3 """ | |
4 | |
5 import os | |
6 | |
5
3f9fac577d75
this now actually makes some tarballs for you
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
7 def which(executable): |
3 | 8 for directory in os.environ['PATH'].split(os.pathsep): |
5
3f9fac577d75
this now actually makes some tarballs for you
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
9 path = os.path.join(directory, executable) |
3 | 10 if os.path.exists(path): |
11 return path | |
12 | |
13 |