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))
wagtailstartproject.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录