Team Ai
Apppublic

abhishekai00/source-code-analyzer

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
template.py36 linesDownload Raw Back to root
1import os2from pathlib import Path3import logging4 5 6logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')7 8 9list_of_files = [10    "src/__init__.py",11    "src/helper.py",12    ".env",13    "setup.py",14    "app.py",15    "research/trials.ipynb"16]17 18 19 20for filepath in list_of_files:21    filepath = Path(filepath)22    filedir, filename = os.path.split(filepath)23 24 25    if filedir !="":26        os.makedirs(filedir, exist_ok=True)27        logging.info(f"Creating directory; {filedir} for the file: {filename}")28 29    if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):30        with open(filepath, "w") as f:31            pass32            logging.info(f"Creating empty file: {filepath}")33 34 35    else:36        logging.info(f"{filename} is already exists")