Spaces:
Sleeping
Sleeping
Avoid adding shapes when there are too many bullet points
Browse files- helpers/pptx_helper.py +2 -1
helpers/pptx_helper.py
CHANGED
|
@@ -225,7 +225,7 @@ def _handle_step_by_step_process(
|
|
| 225 |
shape = shapes.add_shape(MSO_AUTO_SHAPE_TYPE.CHEVRON, left, top, width, height)
|
| 226 |
shape.text = step.removeprefix(STEP_BY_STEP_PROCESS_MARKER)
|
| 227 |
left += width - INCHES_0_4
|
| 228 |
-
elif n_steps
|
| 229 |
# Vertical display
|
| 230 |
height = pptx.util.Inches(0.65)
|
| 231 |
width = pptx.util.Inches(slide_width_inch * 2/ 3)
|
|
@@ -239,6 +239,7 @@ def _handle_step_by_step_process(
|
|
| 239 |
left += INCHES_0_5
|
| 240 |
else:
|
| 241 |
# Two steps -- probably not a process
|
|
|
|
| 242 |
return False
|
| 243 |
|
| 244 |
return True
|
|
|
|
| 225 |
shape = shapes.add_shape(MSO_AUTO_SHAPE_TYPE.CHEVRON, left, top, width, height)
|
| 226 |
shape.text = step.removeprefix(STEP_BY_STEP_PROCESS_MARKER)
|
| 227 |
left += width - INCHES_0_4
|
| 228 |
+
elif 4 < n_steps <= 6:
|
| 229 |
# Vertical display
|
| 230 |
height = pptx.util.Inches(0.65)
|
| 231 |
width = pptx.util.Inches(slide_width_inch * 2/ 3)
|
|
|
|
| 239 |
left += INCHES_0_5
|
| 240 |
else:
|
| 241 |
# Two steps -- probably not a process
|
| 242 |
+
# More than 5--6 steps -- would likely cause a visual clutter
|
| 243 |
return False
|
| 244 |
|
| 245 |
return True
|