refactor: modularize code by creating separate utility modules for environment, configuration, UI setup, API key management, content generation, SEO tools, file processing, and voice processing

This commit is contained in:
ajaysi (aider)
2024-09-14 17:49:34 +05:30
parent 6fe6c52d99
commit 27072adbe5
10 changed files with 302 additions and 69 deletions

View File

@@ -0,0 +1,13 @@
import json
import os
import streamlit as st
def save_config(config):
"""
Saves the provided configuration dictionary to a JSON file specified by the environment variable.
"""
try:
with open(os.getenv("ALWRITY_CONFIG"), "w") as config_file:
json.dump(config, config_file, indent=4)
except Exception as e:
st.error(f"An error occurred while saving the configuration: {e}")