Move magic string and add a comment explaining its role

This commit is contained in:
Bruno Alla 2023-03-16 16:33:17 +00:00
parent 584da767d4
commit 31230de014
No known key found for this signature in database

View File

@ -17,6 +17,14 @@ INFO = "\x1b[1;33m [INFO]: "
HINT = "\x1b[3;33m" HINT = "\x1b[3;33m"
SUCCESS = "\x1b[1;32m [SUCCESS]: " SUCCESS = "\x1b[1;32m [SUCCESS]: "
# The content of this string is evaluated by Jinja, and plays an important role.
# It updates the cookiecutter context to trim leading and trailing spaces
# from domain/email values
"""
{{ cookiecutter.update({ "domain_name": cookiecutter.domain_name | trim }) }}
{{ cookiecutter.update({ "email": cookiecutter.email | trim }) }}
"""
project_slug = "{{ cookiecutter.project_slug }}" project_slug = "{{ cookiecutter.project_slug }}"
if hasattr(project_slug, "isidentifier"): if hasattr(project_slug, "isidentifier"):
assert ( assert (
@ -80,8 +88,3 @@ if (
"Mail Service for sending emails." "Mail Service for sending emails."
) )
sys.exit(1) sys.exit(1)
"""
{{ cookiecutter.update({ "domain_name": cookiecutter.domain_name | trim }) }}
{{ cookiecutter.update({ "email": cookiecutter.email | trim }) }}
"""