Files
limbach/folie9.py
T
marcus hinz 93bb19abf0 initial
2026-06-20 14:40:33 +02:00

123 lines
5.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""Folie 9 Golden Master (adesso-Stil, deutsch, dunkelblau).
Was ist das? · Vorgehen (3 Schritte) · Nutzen 1 + Nutzen 2."""
import os
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR
from pptx.oxml.ns import qn
from adesso_style import (WHITE, INK, BLUE, TEAL, GREEN, CORAL, LIGHT, MUTE, RECF,
F, FC, chrome)
BG = RGBColor(0x0A, 0x3D, 0x6B)
prs = Presentation(); prs.slide_width = Inches(13.333); prs.slide_height = Inches(7.5)
SW, SH = prs.slide_width, prs.slide_height
s = prs.slides.add_slide(prs.slide_layouts[6])
def shp(kind, x, y, w, h, fill=None, line=None, lw=Pt(1), adj=None):
sh = s.shapes.add_shape(kind, Inches(x), Inches(y), Inches(w), Inches(h))
if fill is None: sh.fill.background()
else: sh.fill.solid(); sh.fill.fore_color.rgb = fill
if line is None: sh.line.fill.background()
else: sh.line.color.rgb = line; sh.line.width = lw
if adj is not None:
try: sh.adjustments[0] = adj
except Exception: pass
sh.shadow.inherit = False
return sh
def txt(x, y, w, h, t, size=12, color=WHITE, bold=False, italic=False,
align=PP_ALIGN.LEFT, font=F, anchor=MSO_ANCHOR.MIDDLE):
tb = s.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)); tf = tb.text_frame
tf.word_wrap = True; tf.vertical_anchor = anchor
tf.margin_left = tf.margin_right = tf.margin_top = tf.margin_bottom = Pt(0)
first = True
for line in t.split("\n"):
p = tf.paragraphs[0] if first else tf.add_paragraph(); first = False
p.alignment = align
r = p.add_run(); r.text = line
r.font.size = Pt(size); r.font.bold = bold; r.font.italic = italic
r.font.name = font; r.font.color.rgb = color
return tb
def conn(x1, y1, x2, y2, color=LIGHT, w=2.0):
c = s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1),
Inches(x2), Inches(y2))
c.line.color.rgb = color; c.line.width = Pt(w); c.shadow.inherit = False
ln = c.line._get_or_add_ln()
ln.append(ln.makeelement(qn('a:tailEnd'), {'type': 'triangle'}))
return c
def heading(x, y, t):
shp(MSO_SHAPE.RECTANGLE, x, y + 0.05, 0.16, 0.20, fill=CORAL)
txt(x + 0.26, y - 0.04, 8.0, 0.34, t, size=15, color=WHITE, bold=True,
anchor=MSO_ANCHOR.MIDDLE)
def step(x, y, w, h, num, title, sub):
shp(MSO_SHAPE.ROUNDED_RECTANGLE, x, y, w, h, fill=WHITE, adj=0.08)
shp(MSO_SHAPE.OVAL, x + 0.16, y + 0.16, 0.42, 0.42, fill=BLUE)
txt(x + 0.16, y + 0.16, 0.42, 0.42, str(num), size=15, color=WHITE, bold=True,
align=PP_ALIGN.CENTER)
txt(x + 0.70, y + 0.14, w - 0.85, 0.34, title, size=13, color=INK, bold=True,
anchor=MSO_ANCHOR.TOP)
txt(x + 0.70, y + 0.50, w - 0.85, h - 0.60, sub, size=10.5, color=MUTE,
anchor=MSO_ANCHOR.TOP)
def nutzen(x, y, w, h, title, body):
shp(MSO_SHAPE.ROUNDED_RECTANGLE, x, y, w, h, fill=WHITE, adj=0.05)
shp(MSO_SHAPE.RECTANGLE, x, y + 0.16, 0.13, h - 0.32, fill=CORAL)
txt(x + 0.34, y + 0.20, w - 0.55, 0.40, title, size=15, color=INK, bold=True,
anchor=MSO_ANCHOR.TOP)
txt(x + 0.34, y + 0.70, w - 0.6, h - 0.85, body, size=12, color=INK,
anchor=MSO_ANCHOR.TOP)
# ---- Hintergrund + Header --------------------------------------------------
shp(MSO_SHAPE.RECTANGLE, 0, 0, SW.inches, SH.inches, fill=BG)
chrome(s, "Golden Master", 10)
# ---- Was ist das? ----------------------------------------------------------
heading(0.50, 1.22, "Was ist das?")
shp(MSO_SHAPE.ROUNDED_RECTANGLE, 0.50, 1.58, 12.33, 0.82, fill=WHITE, adj=0.06)
txt(0.78, 1.58, 11.8, 0.82,
"Ein umfassender Acceptance-/Approval-Test der Software: Das System wird als Ganzes gegen einen "
"einmal erfassten, freigegebenen Referenz-Stand („Golden Master“) geprüft — weicht ein "
"Ergebnis ab, schlägt der Test an.",
size=12.5, color=INK)
# ---- Vorgehen --------------------------------------------------------------
heading(0.50, 2.64, "Vorgehen")
SY, SH_ = 3.00, 1.06
step(0.50, SY, 3.70, SH_, 1, "Code- & Ergebnis-Analyse",
"Prüfen, wie die Software arbeitet und wie/wo Ergebnisse abgelegt werden.")
step(4.82, SY, 3.70, SH_, 2, "Testtool aufbauen",
"Werkzeug, das Referenz-Ergebnisse erfasst und bei jedem Lauf vergleicht.")
step(9.13, SY, 3.70, SH_, 3, "Test-Suite (Fachseite)",
"Die FS baut die fachlichen Testfälle / Szenarien auf.")
conn(4.24, SY + SH_ / 2, 4.78, SY + SH_ / 2)
conn(8.56, SY + SH_ / 2, 9.09, SY + SH_ / 2)
# ---- Nutzen ----------------------------------------------------------------
heading(0.50, 4.34, "Nutzen")
NY, NH = 4.70, 2.02
nutzen(0.50, NY, 6.00, NH, "Nutzen 1 · Funktionssicherung CLAB",
"Nach jeder Änderung lässt sich die Funktionsfähigkeit der Software prüfen — "
"schnelle, wiederholbare Regressionssicherheit ohne manuelles Nachtesten.")
nutzen(6.83, NY, 6.00, NH, "Nutzen 2 · Vollständigkeit bei LIS-Migration",
"Ein Ziel-LIS, auf das migriert werden soll, lässt sich hart gegen die eigenen "
"Anforderungen testen.\n\n⚠ Setzt ein neues Aufsetzen des Testtools voraus.")
out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Folie9.pptx")
prs.save(out)
print("saved", out)