def _get_pwd(service=None):
"""
Returns the present working directory for the given service,
or all services if none specified.
"""
def to_text(data):
if six.PY2: # pragma: no cover
data = data.decode(locale.getpreferredencoding(False))
return data
parser = _get_env()
if service:
try:
return to_text(utils.with_trailing_slash(parser.get('env', service)))
except configparser.NoOptionError as e:
six.raise_from(ValueError('%s is an invalid service' % service), e)
return [to_text(utils.with_trailing_slash(value)) for name, value in parser.items('env')]
评论列表
文章目录