Re: CWM Bug: --base broken on stdin

On 10/15/07, Yosi Scharf <syosi@mit.edu> wrote:

> Your shell was telling you that you were in /tmp. However, cwm
> had no way to know that

It could use either or both of the following two methods:

>>> import os
>>> print os.environ.get('PWD')
/tmp

>>> import subprocess
>>> print subprocess.Popen(['pwd'], stdout=subprocess.PIPE,
 shell=True).communicate()[0]
/tmp

And of course should either of these fail then you can rely on
os.getcwd() and so on.

Thanks,

-- 
Sean B. Palmer, http://inamidst.com/sbp/

Received on Monday, 29 October 2007 21:31:13 UTC