From 8a7db9db15b6e51f5856553afa324b0fe1c2f8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EA=B2=BD=EB=AF=BC?= Date: Thu, 19 Mar 2026 14:04:18 +0900 Subject: [PATCH] =?UTF-8?q?Cleanup:=20Deleting=2003.Code/=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=EC=9A=A9/fix=5Fkeys.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03.Code/업로드용/fix_keys.py | 53 ------------------------------------ 1 file changed, 53 deletions(-) delete mode 100644 03.Code/업로드용/fix_keys.py diff --git a/03.Code/업로드용/fix_keys.py b/03.Code/업로드용/fix_keys.py deleted file mode 100644 index ca9e8f0..0000000 --- a/03.Code/업로드용/fix_keys.py +++ /dev/null @@ -1,53 +0,0 @@ -import os, re - -ROOT = r"D:\for python\geulbeot-light\upload" - -replacements = [ - (r'OPENAI_API_KEY\s*=\s*"sk-proj-[^"]*"', - 'OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")'), - (r'GEMINI_API_KEY\s*=\s*"AIza[^"]*"', - 'GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")'), - (r"api_key='sk-ant-[^']*'", - 'api_key=os.environ.get("ANTHROPIC_API_KEY")'), -] - -targets = [ - "converters/pipeline/step3_domain.py", - "converters/pipeline/step4_chunk.py", - "converters/pipeline/step5_rag.py", - "converters/pipeline/step6_corpus.py", - "converters/pipeline/step7_index.py", - "converters/pipeline/step8_content.py", - "handlers/common.py", -] - -# .env 濡 肄 異媛 -dotenv_snippet = "from dotenv import load_dotenv\nload_dotenv()\n" - -for rel_path in targets: - path = os.path.join(ROOT, rel_path) - with open(path, encoding="utf-8") as f: - content = f.read() - if "load_dotenv" not in content: - content = dotenv_snippet + content - with open(path, "w", encoding="utf-8") as f: - f.write(content) - print(f" - dotenv 異媛: {rel_path}") - changed = False - for pattern, replacement in replacements: - new_content = re.sub(pattern, replacement, content) - if new_content != content: - content = new_content - changed = True - - if changed: - with open(path, "w", encoding="utf-8") as f: - f.write(content) - print(f" - : {rel_path}") - else: - print(f" 蹂寃쎌: {rel_path}") - -print("\n - 猷!")