Update fund.py
Browse files37 unmodified lines383940414243444546474849501414 unmodified lines146514661467146814691470147119 unmodified lines149114921493149414951496149714981499150015011502150315041505150615071508150937 unmodified lines# ============================================================================# cache_db 연동 (app.py 통합 시 DB 저장/불러오기)# ============================================================================try:from cache_db import get_fund_cache_fund_cache = get_fund_cache()HAS_CACHE_DB = Trueexcept ImportError:HAS_CACHE_DB = False_fund_cache = None# ============================================================================# CUSTOM CSS - 울트라 다크 메탈릭 + 네온 글로우 테마1414 unmodified linesop_profit, net_income, interest_exp, caution_checks,existing_guar, related_sales):"""분석 결과 저장"""if not HAS_CACHE_DB:return "⚠️ cache_db 모듈을 찾을 수 없습니다. app.py 통합 환경에서 실행해주세요."if not email or '@' not in email:19 unmodified lines"version": "v7.0"}success, msg = _fund_cache.save_fund_analysis(email, company_info, financial_info, caution_checks, analysis_results)return msgdef load_fund_results(email):"""저장된 분석 기록 불러오기 → 입력 필드에 복원"""if not HAS_CACHE_DB:return [gr.update()] * 22 + ["⚠️ cache_db 모듈을 찾을 수 없습니다. app.py 통합 환경에서 실행해주세요."]if not email or '@' not in email:return [gr.update()] * 22 + ["⚠️ 올바른 이메일 주소를 입력해주세요."]record, msg = _fund_cache.load_fund_profile(email)if record is None:return [gr.update()] * 22 + [msg]37 unmodified lines38394041424344454647484950515253545556575859601414 unmodified lines1475147614771478147914801481148219 unmodified lines1502150315041505150615071508150915101511151215131514151515161517151815191520152137 unmodified lines# ============================================================================# cache_db 연동 (app.py 통합 시 DB 저장/불러오기)# ============================================================================HAS_CACHE_DB = False_fund_cache = Nonedef _get_fund_cache():"""지연 초기화 - 실제 사용 시점에 cache_db 로드"""global HAS_CACHE_DB, _fund_cacheif _fund_cache is not None:return _fund_cachetry:from cache_db import get_fund_cache_fund_cache = get_fund_cache()HAS_CACHE_DB = Truereturn _fund_cacheexcept ImportError:HAS_CACHE_DB = False_fund_cache = Nonereturn None# ============================================================================# CUSTOM CSS - 울트라 다크 메탈릭 + 네온 글로우 테마1414 unmodified linesop_profit, net_income, interest_exp, caution_checks,existing_guar, related_sales):"""분석 결과 저장"""cache = _get_fund_cache()if cache is None:return "⚠️ cache_db 모듈을 찾을 수 없습니다. app.py 통합 환경에서 실행해주세요."if not email or '@' not in email:19 unmodified lines"version": "v7.0"}success, msg = cache.save_fund_analysis(email, company_info, financial_info, caution_checks, analysis_results)return msgdef load_fund_results(email):"""저장된 분석 기록 불러오기 → 입력 필드에 복원"""cache = _get_fund_cache()if cache is None:return [gr.update()] * 22 + ["⚠️ cache_db 모듈을 찾을 수 없습니다. app.py 통합 환경에서 실행해주세요."]if not email or '@' not in email:return [gr.update()] * 22 + ["⚠️ 올바른 이메일 주소를 입력해주세요."]record, msg = cache.load_fund_profile(email)if record is None:return [gr.update()] * 22 + [msg]
fund.py+23-11