wagtailstartproject.py 文件源码

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

项目:wagtail-startproject 作者: leukeleu 项目源码 文件源码
def check_project_name(parser, project_name):
    """Perform checks for the given project name.

    Checks:
    - not a reserved Python keyword.
    - not already in use by another Python package/module.

    """
    if iskeyword(project_name):
        parser.error("'{project_name}' can not be a reserved Python keyword.".format(project_name=project_name))

    try:
        __import__(project_name)
    except ImportError:
        pass
    else:
        parser.error("'{project_name}' conflicts with the name of an existing "
                     "Python module and cannot be used as a project "
                     "name. Please try another name.".format(project_name=project_name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号