diff --git a/utils/__pycache__/tweet_generator.cpython-312.pyc b/utils/__pycache__/tweet_generator.cpython-312.pyc index 29e0a91..b6849f7 100644 Binary files a/utils/__pycache__/tweet_generator.cpython-312.pyc and b/utils/__pycache__/tweet_generator.cpython-312.pyc differ diff --git a/utils/tweet_generator.py b/utils/tweet_generator.py index 7afd917..7ca1ee6 100644 --- a/utils/tweet_generator.py +++ b/utils/tweet_generator.py @@ -556,6 +556,19 @@ def generate_posters_for_topic(config, topic_item, tweet_content_list, output_di if not poster_text_configs_raw: logging.warning("Warning: ContentGenerator returned empty configuration data. Skipping posters.") return False + + # --- Save the COMPLETE poster configs list for this topic --- + run_output_dir_base = os.path.join(output_dir, run_id) + topic_config_save_path = os.path.join(run_output_dir_base, f"topic_{topic_index}_poster_configs.json") + try: + # Assuming poster_text_configs_raw is JSON-serializable (likely a list/dict) + with open(topic_config_save_path, 'w', encoding='utf-8') as f_cfg_topic: + json.dump(poster_text_configs_raw, f_cfg_topic, ensure_ascii=False, indent=4) + logging.info(f"Saved complete poster configurations for topic {topic_index} to: {topic_config_save_path}") + except Exception as save_err: + logging.error(f"Failed to save complete poster configurations for topic {topic_index} to {topic_config_save_path}: {save_err}") + # --- End Save Complete Config --- + poster_config_summary = core_posterGen.PosterConfig(poster_text_configs_raw) except Exception as e: logging.exception("Error running ContentGenerator or parsing poster configs:") @@ -579,7 +592,7 @@ def generate_posters_for_topic(config, topic_item, tweet_content_list, output_di continue # Define output directories for this specific variant - run_output_dir = os.path.join(output_dir, run_id) # Base dir for the run + run_output_dir = os.path.join(output_dir, run_id) variant_output_dir = os.path.join(run_output_dir, f"{topic_index}_{variant_index}") output_collage_subdir = config.get("output_collage_subdir", "collage_img") output_poster_subdir = config.get("output_poster_subdir", "poster")