diff --git a/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py b/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py index 1ed8619..740741c 100644 --- a/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py +++ b/python-naive/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__project_slug }}.py @@ -87,6 +87,11 @@ logging.basicConfig( log = logging.getLogger("rich") # Our own code logs with this level log.setLevel(os.environ.get("LOGLEVEL") if "LOGLEVEL" in [k for k, v in os.environ.items()] else logging.INFO) +{%- endif %}{%- if cookiecutter.use_rich_logging == "no" %} +{% endif %} +{%- if cookiecutter.use_inflect == "yes" %} + +p = inflect.engine() {%- endif %} {%- if cookiecutter.use_config_ini == "yes" %} @@ -196,11 +201,11 @@ def validate_config_sections( unset_options = we_have_unset_options(config_obj, this_section) if unset_options: - {% if cookiecutter.use_rich_logging == "yes" -%}log.error{%- else -%}print{%- endif %}(f"""{p.plural("Option", len(unset_options))} {unset_options} """ - {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{p.plural("is", len(unset_options))} unset. """ - {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{p.singular_noun("They", len(unset_options))} """ + {% if cookiecutter.use_rich_logging == "yes" -%}log.error{%- else -%}print{%- endif %}(f"""{% if cookiecutter.use_inflect == "yes" %}{p.plural("Option", len(unset_options))}{% else %}Options{% endif %} {unset_options} """ + {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{% if cookiecutter.use_inflect == "yes" %}{p.plural("is", len(unset_options))}{% else %}are{% endif %} unset. """ + {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{% if cookiecutter.use_inflect == "yes" %}{p.singular_noun("They", len(unset_options))}{% else %}They{% endif %} """ {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"must have a non-null value. " - {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{p.plural("Default", len(unset_options))} {p.plural("is", len(unset_options))}:""") + {% if cookiecutter.use_rich_logging == "yes" %} {% endif %}f"""{% if cookiecutter.use_inflect == "yes" %}{p.plural("Default", len(unset_options))} {p.plural("is", len(unset_options))}{% else %}Defaults are{% endif %}:""") for unset_option in unset_options: {% if cookiecutter.use_rich_logging == "yes" -%}log.error{%- else -%}print{%- endif %}(f"{unset_option} = {internal_defaults[unset_option]}") {% if cookiecutter.use_rich_logging == "yes" -%}log.error{%- else -%}print{%- endif %}(f"Exiting 7 ...")