diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 3f60bb7..7fcead0 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -3,7 +3,7 @@ def set_python_version(): - python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor) + python_version = f"{str(sys.version_info.major)}.{str(sys.version_info.minor)}" file_names = ["Dockerfile", "Pipfile", ".github/workflows/test.yml"] for file_name in file_names: @@ -15,8 +15,8 @@ def set_python_version(): def remove_main_if_lib(): is_lib = '{{ cookiecutter.binary }}' - main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py') - if not (is_lib == "y" or is_lib == "Y"): + if is_lib not in {"y", "Y"}: + main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py') os.remove(main_file_path) print(main_file_path) @@ -28,7 +28,7 @@ def remove_main_if_lib(): def main(): set_python_version() remove_main_if_lib() - print(SUCCESS + "Project successfully initialized" + TERMINATOR) + print(f"{SUCCESS}Project successfully initialized{TERMINATOR}") if __name__ == "__main__":