7 from os
import environ
,path
10 if path
.exists(filename
):
13 for v
in ["PATH","LD_LIBRARY_PATH"]:
15 for d
in environ
[v
].split(':'):
16 if path
.exists(path
.join(d
,filename
)):
17 fullFile
=path
.join(d
,filename
)
25 if path
.exists(fullFile
):
28 result
=subprocess
.Popen(["xcrun", "atos",
31 stdout
=subprocess
.PIPE
33 match
=re
.compile('.+ \((.+)\) \((.+)\)').match(result
)
35 answer
=match
.group(2)+" "+match
.group(1)
38 result
=subprocess
.Popen(["xcrun", "atos",
39 "-p",str(os
.getppid()),
41 stdout
=subprocess
.PIPE
43 match
=re
.compile('.+ \((.+)\) \((.+)\)').match(result
)
45 answer
=match
.group(2)+" "+match
.group(1)