base.py 文件源码

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

项目:djangoeurope-fabfile 作者: wservices 项目源码 文件源码
def get_daemon(initfile):
    """ Parse DAEMON variable in the init file """
    re_daemon = re.compile('^DAEMON=(.+)$', re.MULTILINE)

    if not exists(initfile):
        return None

    local_file = get(initfile)

    f = open(local_file[0], 'r')
    data = f.read()
    f.close()

    match = re_daemon.search(data)
    daemon = ''
    if match:
        daemon = match.group(1)
    if not exists(daemon):
        return None
    return daemon
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号