cli.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:stor 作者: counsyl 项目源码 文件源码
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')]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号