MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / normalize_config_values

Function normalize_config_values

utils/config_utils.py:211–241  ·  view source on GitHub ↗

Normalize configuration values to proper types. Args: Font sizes and colors (raw from YAML) Returns: Tuple of normalized values

(
    bullet_fs, title_fs, poster_title_fs, poster_author_fs,
    title_text_color, title_fill_color, main_text_color, main_text_fill_color
)

Source from the content-addressed store, hash-verified

209
210
211def normalize_config_values(
212 bullet_fs, title_fs, poster_title_fs, poster_author_fs,
213 title_text_color, title_fill_color, main_text_color, main_text_fill_color
214):
215 """
216 Normalize configuration values to proper types.
217
218 Args:
219 Font sizes and colors (raw from YAML)
220
221 Returns:
222 Tuple of normalized values
223 """
224 bullet_fs = to_int_or_none(bullet_fs)
225 title_fs = to_int_or_none(title_fs)
226 poster_title_fs = to_int_or_none(poster_title_fs)
227 poster_author_fs = to_int_or_none(poster_author_fs)
228
229 # Default: use bullet font size for title if not specified
230 if title_fs is None:
231 title_fs = bullet_fs
232
233 title_text_color = to_color_tuple_or_none(title_text_color)
234 title_fill_color = to_color_tuple_or_none(title_fill_color)
235 main_text_color = to_color_tuple_or_none(main_text_color)
236 main_text_fill_color = to_color_tuple_or_none(main_text_fill_color)
237
238 return (
239 bullet_fs, title_fs, poster_title_fs, poster_author_fs,
240 title_text_color, title_fill_color, main_text_color, main_text_fill_color
241 )

Callers 1

new_pipeline.pyFile · 0.90

Calls 2

to_int_or_noneFunction · 0.70
to_color_tuple_or_noneFunction · 0.70

Tested by

no test coverage detected