Spaces:
Runtime error
Runtime error
Prevent the addition of empty slide when the number of steps are too few or many
Browse files91 unmodified lines9293949596959697523 unmodified lines62162262362462562662762862963063136 unmodified lines66866967066866967067167167267391 unmodified lines
# Add content in a loop for a_slide in parsed_data['slides']: # The loop has a bug: # if any of this functions fail (i.e., returns False), an empty slide would still exist is_processing_done = _handle_double_col_layout( presentation=presentation, slide_json=a_slide,523 unmodified lines ): return False
if n_steps < 3 or n_steps > 6: # Two steps -- probably not a process # More than 5--6 steps -- would likely cause a visual clutter return False
bullet_slide_layout = presentation.slide_layouts[1] slide = presentation.slides.add_slide(bullet_slide_layout) shapes = slide.shapes36 unmodified lines shape.text = step.removeprefix(STEP_BY_STEP_PROCESS_MARKER) top += height + INCHES_0_3 left += INCHES_0_5 else: # Two steps -- probably not a process # More than 5--6 steps -- would likely cause a visual clutter return False
return True
helpers/pptx_helper.py+5-6