Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,6 +69,50 @@ def generate_presentation_content(topic, client):
|
|
| 69 |
|
| 70 |
def apply_design(prs, design):
|
| 71 |
# ... [El código de la función apply_design permanece igual] ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
def create_powerpoint(slides, design):
|
| 74 |
prs = Presentation()
|
|
|
|
| 69 |
|
| 70 |
def apply_design(prs, design):
|
| 71 |
# ... [El código de la función apply_design permanece igual] ...
|
| 72 |
+
def apply_design(prs, design):
|
| 73 |
+
if design == "Moderno":
|
| 74 |
+
background = prs.slides[0].background
|
| 75 |
+
fill = background.fill
|
| 76 |
+
fill.solid()
|
| 77 |
+
fill.fore_color.rgb = RGBColor(240, 240, 240)
|
| 78 |
+
|
| 79 |
+
for slide in prs.slides:
|
| 80 |
+
for shape in slide.shapes:
|
| 81 |
+
if shape.has_text_frame:
|
| 82 |
+
tf = shape.text_frame
|
| 83 |
+
tf.text = tf.text
|
| 84 |
+
for paragraph in tf.paragraphs:
|
| 85 |
+
paragraph.font.color.rgb = RGBColor(0, 0, 0)
|
| 86 |
+
if shape.name == 'Title':
|
| 87 |
+
paragraph.font.size = Pt(44)
|
| 88 |
+
else:
|
| 89 |
+
paragraph.font.size = Pt(24)
|
| 90 |
+
elif design == "Corporativo":
|
| 91 |
+
background = prs.slides[0].background
|
| 92 |
+
fill = background.fill
|
| 93 |
+
fill.solid()
|
| 94 |
+
fill.fore_color.rgb = RGBColor(255, 255, 255)
|
| 95 |
+
|
| 96 |
+
for slide in prs.slides:
|
| 97 |
+
left = top = Inches(0.5)
|
| 98 |
+
width = Inches(1)
|
| 99 |
+
height = Inches(0.5)
|
| 100 |
+
shape = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, left, top, width, height)
|
| 101 |
+
shape.fill.solid()
|
| 102 |
+
shape.fill.fore_color.rgb = RGBColor(0, 112, 192)
|
| 103 |
+
|
| 104 |
+
for shape in slide.shapes:
|
| 105 |
+
if shape.has_text_frame:
|
| 106 |
+
tf = shape.text_frame
|
| 107 |
+
tf.text = tf.text
|
| 108 |
+
for paragraph in tf.paragraphs:
|
| 109 |
+
paragraph.font.color.rgb = RGBColor(0, 0, 0)
|
| 110 |
+
if shape.name == 'Title':
|
| 111 |
+
paragraph.font.size = Pt(40)
|
| 112 |
+
paragraph.font.color.rgb = RGBColor(0, 112, 192)
|
| 113 |
+
else:
|
| 114 |
+
paragraph.font.size = Pt(20)
|
| 115 |
+
|
| 116 |
|
| 117 |
def create_powerpoint(slides, design):
|
| 118 |
prs = Presentation()
|