diagnose.py 文件源码

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

项目:dingdang-robot 作者: wzpan 项目源码 文件源码
def get_pip_requirements(fname=os.path.join(dingdangpath.LIB_PATH,
                                            'requirements.txt')):
    """
    Gets the PIP requirements from a text file. If the files does not exists
    or is not readable, it returns None

    Arguments:
        fname -- (optional) the requirement text file (Default:
                 "client/requirements.txt")

    Returns:
        A list of pip requirement objects or None
    """
    logger = logging.getLogger(__name__)
    if os.access(fname, os.R_OK):
        reqs = list(pip.req.parse_requirements(fname))
        logger.debug("Found %d PIP requirements in file '%s'", len(reqs),
                     fname)
        return reqs
    else:
        logger.debug("PIP requirements file '%s' not found or not readable",
                     fname)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号