# This file is part of djpro.## Copyright (c) 2024, Franco Gidaszewski <gidaszewskifranco@gmail.com>## For the full copyright and license information, please view# the LICENSE.txt file that was distributed with this source code.frompathlibimportPathfrom..utils.loggingimportlogging,log_with_color,Forefrom.files_contentimport(settings_api,settings_unfold,settings_api_unfold,settings_base_content,requirements_api,requirements_unfold,)
[docs]defcreate_dirs(dirs:list[Path]):"""Function to create folders"""fordirindirs:dir.mkdir(parents=True,exist_ok=True)
[docs]defcreate_files(files:list[Path]):"""Function to create files."""forfile_pathinfiles:file_path.parent.mkdir(parents=True,exist_ok=True)file_path.touch()
[docs]defwrite_to_file(file_path:Path,content:str,mode:str="w"):"""Function to write content."""file_path.parent.mkdir(parents=True,exist_ok=True)withopen(file_path,mode)asf:f.write(content)