Zusammengefuehrt: SONDERFAELLE -> SPECIALFAELLE; MODI-KETTE, SPIELARTEN -> MODI; CLIENT-CODE, GEFUNDE-GELD-TAGS, FENSTER-KATALOG -> CLIENT-LUECKEN; FENSTER-und-EINGABE, MESSUNG-eingabe, GERUEST -> EINGABE-WARUM; KACHELN-AX -> TISCHKANAL; MENSCHLICH -> UNUNTERSCHEIDBAR; TURNIER-ANMELDUNG-LIVE, Buehnen-Vorfall -> TURNIERE; GELD-SIMULATION, RUHM -> GELD; RAKE-gemessen -> RAUMWAHRHEITEN; SFS2X-Runde und Ausfall 31.10. -> ANGRIFFSFLaeCHE; EINVERSTAENDNIS -> BETRUG-UND-REGELN; acht VORFALL-* -> neues VORFAELLE.md. Typ-2-Sitout-Messung aus ABNAHME -> ZURUECK; AKTION-KANAL 4/5 als erledigt markiert. Geloescht: LUECKEN, MITTLER-IST-DER-WEG, CASINO-ANGRIFF, TRAGLAST, UMGEBUNG, ABNAHME-2026-11-05, BLUFF, TOTER-TISCH. Verweise in Code, Specs, Docs, Plaenen und den hof-Listen nachgezogen (nur Kommentare/Listen, keine Logik). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
411 lines
18 KiB
Python
411 lines
18 KiB
Python
#!/usr/bin/env python3
|
|
"""Hof: ein sauberer Nachbarbaum, in dem die scharfe Seite nicht existiert.
|
|
|
|
python3 werkzeuge/hof.py --bauen Hof anlegen / auffrischen, dann pruefen
|
|
python3 werkzeuge/hof.py --bericht nur pruefen: nennt der Hof etwas, das fehlt?
|
|
python3 werkzeuge/hof.py --zeigen Uebernahme ansehen, nichts schreiben
|
|
python3 werkzeuge/hof.py --uebernehmen geliehene Aenderungen zurueckholen
|
|
|
|
Warum: eine Sperrliste muss vollstaendig sein und wird auditiert. Ein Ort kann das nicht - was
|
|
nicht da ist, kann man nicht falsch verstecken. Der Hof enthaelt genau das, was der Rechner, der
|
|
Leser und der Simulator brauchen, und sonst nichts.
|
|
|
|
Grenze (gemessen, nicht geraten): sechs Ordner ganz, vier Einzeldateien, das Archiv. Draussen
|
|
bleiben `sicht`, `mac`, `werkzeuge`, `korpus` und der Rest von `lobby`/`mcp` - zusammen mit den
|
|
Erzaehltexten im Wurzelverzeichnis und den alten Auftraegen.
|
|
"""
|
|
import difflib
|
|
import hashlib
|
|
import json
|
|
import os
|
|
import re
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
|
|
HIER = os.path.dirname(os.path.abspath(__file__))
|
|
WURZEL = os.path.dirname(HIER)
|
|
sys.path.insert(0, HIER)
|
|
from hof_story import ARCHIV_TEXTE_WELT, STORY_TEXTE, STORY_TEXTE_WELT # noqa: E402
|
|
|
|
VOLL = os.environ.get("HOF_ART") == "voll" # voll: die Erzaehltexte bleiben stehen
|
|
WELT = not VOLL
|
|
HOF = os.path.join(os.path.dirname(WURZEL), "pokerfreak-sim" if VOLL else "pokersim")
|
|
# Die Welt (pokersim) ist der ganze Baum - nur ohne Erzaehltexte.
|
|
WELT_ORDNER = ("src", "client", "lesen", "mock", "hand", "betrieb", "entscheiden", "sicht", "mac",
|
|
"mcp", "archiv", "docs")
|
|
ENGINE_ORDNER = ("hand", "betrieb", "entscheiden", "mcp", "lobby", "korpus", "src")
|
|
STAND = os.path.join(WURZEL, "scratch", "hof-stand.json")
|
|
|
|
ORDNER = ("src", "client", "lesen", "mock", "hand", "betrieb", "entscheiden", "sicht", "mac", "mcp", "korpus")
|
|
EINZELN = (("lobby", "auswahl.py"), ("lobby", "cdp.mjs"), ("lobby", "zustand.py"),
|
|
("mcp", "stopp.py"), ("mcp", "lobby_adapter.py"))
|
|
ARCHIV = ("mitschrieb", "lauf", "bilder")
|
|
# Aus archiv/mitschrieb bleiben nur die Mitschriebe und die wenigen Texte, die eine Pruefung wirklich
|
|
# liest. Die uebrigen Befund-Texte erzaehlen - und wer sie liest, faengt an zu urteilen.
|
|
ARCHIV_TEXTE = ("PIPE-UND-BRUECKE.md", "RAUMWAHRHEITEN.md", "CLIENT-LUECKEN.md",
|
|
"EINGABE-WARUM.md", "KATALOG.md", "VORFAELLE.md")
|
|
ARCHIV_DATEIEN = ("rec-log.log",)
|
|
ZUSATZ = ("docs/VERTRAG.md", "docs/SCHNITTSTELLE.md", "tests/wache/sitecustomize.py", "tests/lauf.py",
|
|
"target/release/rechner", "docs/notizen/AUFTRAG-klon-ist-der-client.md", "tests/klonlauf.py")
|
|
STORY = ("CLAUDE.md", "LOS.md", ".gitignore", "tests/OHNE")
|
|
ABWESEND = ("werkzeuge",)
|
|
NICHT_AUSWERTEN = ("http", "127.0.0.1", "node", "open", "cd")
|
|
# Nur diese Namen sind Ordner. Alles andere in der Form 'a/b' ist Text (usr/bin, bb/100, api/x).
|
|
BEKANNT = ORDNER + tuple(d for d, _ in EINZELN) + ABWESEND + ("archiv", "docs", "tests")
|
|
SPUR = re.compile(r'\b([a-z_]+)/([A-Za-z0-9_.-]+)')
|
|
TESTSPUR = re.compile(r'\btests/([A-Za-z0-9_.-]+)')
|
|
|
|
|
|
def rel(p):
|
|
"""Pfad relativ zum Hof - der Hof ist die Welt, der Baum liegt woanders."""
|
|
wurzel = HOF if os.path.abspath(p).startswith(os.path.abspath(HOF)) else WURZEL
|
|
return os.path.relpath(p, wurzel).replace(os.sep, "/")
|
|
|
|
|
|
def liste(wurzel):
|
|
ohne = ("__pycache__", ".git", "scratch", ".DS_Store", "target", "mutants.out")
|
|
for root, ordner, dateien in os.walk(wurzel):
|
|
ordner[:] = [o for o in ordner if o not in ohne]
|
|
for d in dateien:
|
|
if d in ohne or d.endswith(".pyc"):
|
|
continue
|
|
yield rel(os.path.join(root, d))
|
|
|
|
|
|
def kopiere(quelle, ziel):
|
|
os.makedirs(os.path.dirname(ziel), exist_ok=True)
|
|
shutil.copy2(quelle, ziel)
|
|
|
|
|
|
def sha(p):
|
|
return hashlib.sha256(open(p, "rb").read()).hexdigest()[:16]
|
|
|
|
|
|
def text(p):
|
|
return open(p, encoding="utf-8", errors="replace").read()
|
|
|
|
|
|
# ---------------------------------------------------------------- pruefen
|
|
|
|
def vorhanden(d, name):
|
|
"""Liegt 'd/name' im Hof? Die Endung darf fehlen, dann zaehlt irgendeine."""
|
|
ordner = os.path.join(HOF, d)
|
|
if not os.path.isdir(ordner):
|
|
return False
|
|
if name in os.listdir(ordner):
|
|
return True
|
|
stamm = name.split(".")[0] # hand/foto.py. und hand/sitzen.Stellen.klon
|
|
return any(n.split(".")[0] == stamm for n in os.listdir(ordner))
|
|
|
|
|
|
def nennt_fremdes(t):
|
|
"""Nennt der Text einen Ordner oder eine Datei, die im Hof NICHT liegen?"""
|
|
for d, n in SPUR.findall(t):
|
|
if d not in BEKANNT or d == "tests":
|
|
continue # Pruefungsnamen werden nachgezogen
|
|
if d in ABWESEND or not vorhanden(d, n):
|
|
return True
|
|
return False
|
|
|
|
|
|
def bericht(zeigen=True):
|
|
"""Code muss sauber sein; Befund-Texte (Archiv, Story) duerfen Nachbarn nennen."""
|
|
code, befund = [], []
|
|
for r in sorted(liste(HOF)):
|
|
if not r.endswith((".py", ".rs", ".md", ".mjs", ".json")):
|
|
continue
|
|
for i, zeile in enumerate(text(os.path.join(HOF, r)).splitlines(), 1):
|
|
for d, n in SPUR.findall(zeile):
|
|
if d not in BEKANNT or d == "tests":
|
|
continue
|
|
if not vorhanden(d, n):
|
|
frei = (befund if (r.startswith("archiv/") or r in STORY) else code)
|
|
if WELT and d in ENGINE_ORDNER:
|
|
frei = befund # die gedockte Engine: Befund, nicht Fehler
|
|
frei.append(f"{r}:{i}: {d}/{n}")
|
|
if zeigen:
|
|
print(f"Bericht: Code {len(code)} Stellen, Befund-Texte {len(befund)} Stellen")
|
|
for s in code + befund:
|
|
print(" ", s)
|
|
return len(code)
|
|
|
|
|
|
def genannte_pruefungen():
|
|
"""Jede Pruefungsdatei, die der Hof nennt - als 'tests/x' oder als blosser Dateiname."""
|
|
namen = set()
|
|
for r in liste(HOF):
|
|
if not r.endswith((".py", ".rs", ".md")):
|
|
continue
|
|
t = text(os.path.join(HOF, r))
|
|
namen |= set(TESTSPUR.findall(t))
|
|
namen |= set(re.findall(r'\b([a-z0-9_]+_spec\.py)\b', t))
|
|
return sorted(n for n in namen if os.path.exists(os.path.join(WURZEL, "tests", n)))
|
|
|
|
|
|
# ---------------------------------------------------------------- bauen
|
|
|
|
def kopiere_grundstock():
|
|
if WELT: # die Welt nimmt ihre Ordner und die zwei Client-Dateien
|
|
for d in WELT_ORDNER:
|
|
ziel = os.path.join(HOF, d)
|
|
if os.path.isdir(ziel):
|
|
shutil.rmtree(ziel)
|
|
shutil.copytree(os.path.join(WURZEL, d), ziel,
|
|
ignore=shutil.ignore_patterns("__pycache__", "scratch", ".DS_Store", ".build", "build"))
|
|
# Erzaehltexte, die von aussen erzaehlen: raus aus der Welt
|
|
for n in os.listdir(os.path.join(HOF, "archiv", "mitschrieb")):
|
|
if n.endswith(".md") and n not in ARCHIV_TEXTE_WELT:
|
|
os.remove(os.path.join(HOF, "archiv", "mitschrieb", n))
|
|
# docs/ auf die zwei Vertraege kuerzen; ein Auftrag gehoert nach oben
|
|
|
|
for n in os.listdir(os.path.join(HOF, "docs")):
|
|
if n not in ("SCHNITTSTELLE.md", "VERTRAG.md", "SPRACHE.md", "WAS.md"):
|
|
q = os.path.join(HOF, "docs", n)
|
|
shutil.rmtree(q) if os.path.isdir(q) else os.remove(q)
|
|
if os.path.exists(os.path.join(HOF, "mac", "README.md")):
|
|
os.remove(os.path.join(HOF, "mac", "README.md"))
|
|
for n in os.listdir(HOF): # stehengebliebene Texte oben wegraeumen
|
|
if n.endswith(".md") and n not in ("CLAUDE.md", "LOS.md") and not n.startswith("AUFTRAG-klon-ist"):
|
|
os.remove(os.path.join(HOF, n))
|
|
for n in os.listdir(os.path.join(WURZEL, "docs", "notizen")): # der laufende Auftrag, oben
|
|
if n.startswith("AUFTRAG-klon-ist"):
|
|
kopiere(os.path.join(WURZEL, "docs", "notizen", n), os.path.join(HOF, n))
|
|
shutil.copytree(os.path.join(WURZEL, "tests"), os.path.join(HOF, "tests"),
|
|
dirs_exist_ok=True, ignore=shutil.ignore_patterns("__pycache__"))
|
|
shutil.copytree(os.path.join(WURZEL, "tests"), os.path.join(HOF, "tests"),
|
|
dirs_exist_ok=True, ignore=shutil.ignore_patterns("__pycache__"))
|
|
for n in ("lauf.py", "klonlauf.py"): # der Lauf und der Beweis der Naht
|
|
kopiere(os.path.join(WURZEL, "tests", n), os.path.join(HOF, "tests", n))
|
|
kopiere(os.path.join(WURZEL, "tests", "wache", "sitecustomize.py"), os.path.join(HOF, "tests", "wache", "sitecustomize.py"))
|
|
shutil.rmtree(os.path.join(HOF, "tests", "__pycache__"), ignore_errors=True)
|
|
# sonst liegen .pyc mit alten Dateinamen herum
|
|
for d, n in EINZELN:
|
|
kopiere(os.path.join(WURZEL, d, n), os.path.join(HOF, d, n))
|
|
for n in ARCHIV_DATEIEN:
|
|
kopiere(os.path.join(WURZEL, "archiv", n), os.path.join(HOF, "archiv", n))
|
|
for r in ZUSATZ:
|
|
if os.path.exists(os.path.join(WURZEL, r)):
|
|
kopiere(os.path.join(WURZEL, r), os.path.join(HOF, r))
|
|
for d in ("sicht/scratch", "scratch", "hand/scratch", "betrieb/scratch"):
|
|
os.makedirs(os.path.join(HOF, d), exist_ok=True)
|
|
return
|
|
for d in ORDNER:
|
|
ziel = os.path.join(HOF, d)
|
|
if os.path.isdir(ziel):
|
|
shutil.rmtree(ziel)
|
|
shutil.copytree(os.path.join(WURZEL, d), ziel,
|
|
ignore=shutil.ignore_patterns("__pycache__", "scratch", ".DS_Store", ".build", "build"))
|
|
for d, n in EINZELN:
|
|
kopiere(os.path.join(WURZEL, d, n), os.path.join(HOF, d, n))
|
|
for d in ARCHIV:
|
|
ziel = os.path.join(HOF, "archiv", d)
|
|
if os.path.isdir(ziel):
|
|
shutil.rmtree(ziel)
|
|
shutil.copytree(os.path.join(WURZEL, "archiv", d), ziel,
|
|
ignore=shutil.ignore_patterns("__pycache__", ".DS_Store"))
|
|
for n in ARCHIV_DATEIEN:
|
|
kopiere(os.path.join(WURZEL, "archiv", n), os.path.join(HOF, "archiv", n))
|
|
erlaubt = ARCHIV_TEXTE_WELT if WELT else ARCHIV_TEXTE
|
|
for n in os.listdir(os.path.join(HOF, "archiv", "mitschrieb")):
|
|
if n.endswith(".md") and n not in erlaubt:
|
|
os.remove(os.path.join(HOF, "archiv", "mitschrieb", n))
|
|
for r in ZUSATZ:
|
|
if os.path.exists(os.path.join(WURZEL, r)):
|
|
kopiere(os.path.join(WURZEL, r), os.path.join(HOF, r))
|
|
for d in ("hand/scratch", "betrieb/scratch", "sicht/scratch", "mac/build", "scratch"):
|
|
os.makedirs(os.path.join(HOF, d), exist_ok=True)
|
|
|
|
|
|
def waehle_pruefungen():
|
|
"""Pruefungen, die nur von dem leben, was hier liegt. Fuer die Welt: nichts aus der Engine."""
|
|
behalten, weg = [], []
|
|
fremd = ENGINE_ORDNER if WELT else ()
|
|
for n in sorted(os.listdir(os.path.join(WURZEL, "tests"))):
|
|
if not n.endswith("_spec.py"):
|
|
continue
|
|
t = text(os.path.join(WURZEL, "tests", n))
|
|
# Die Welt waehlt nach IMPORTEN (Prosa darf die gedockte Engine nennen); der volle Hof
|
|
# waehlt nach Erwaehnungen, weil es dort keine draussen gibt.
|
|
raus = "klonlauf" in t or (any(braucht_engine(n) for n in importe(t)) if WELT
|
|
else nennt_fremdes(t))
|
|
(weg if raus else behalten).append(n)
|
|
return behalten, weg
|
|
|
|
|
|
def importe(t):
|
|
namen = set()
|
|
for m in re.finditer(r'^\s*(?:import|from)\s+([A-Za-z_][\w.]*)', t, re.M):
|
|
namen.add(m.group(1).split(".")[0])
|
|
return namen
|
|
|
|
|
|
def braucht_engine(name):
|
|
"""Findet die Welt dieses Modul nicht, liegt es in der gedockten Engine."""
|
|
if os.path.exists(os.path.join(WURZEL, "tests", name + ".py")):
|
|
return False
|
|
for d in WELT_ORDNER + ("tests",):
|
|
if os.path.exists(os.path.join(WURZEL, d, name + ".py")):
|
|
return False
|
|
for d in ENGINE_ORDNER:
|
|
if os.path.exists(os.path.join(WURZEL, d, name + ".py")):
|
|
return True
|
|
return False
|
|
|
|
|
|
def fehlende_module(aus):
|
|
return sorted(set(re.findall(r"No module named '([^']+)'", aus)))
|
|
|
|
|
|
def quelle_fuer(name):
|
|
for d in ORDNER + tuple(d for d, _ in EINZELN):
|
|
q = os.path.join(WURZEL, d, name + ".py")
|
|
if os.path.exists(q):
|
|
return d, name
|
|
return None, name
|
|
|
|
|
|
def lauf():
|
|
r = subprocess.run([sys.executable, os.path.join(HOF, "tests", "lauf.py"), "schnell"],
|
|
capture_output=True, text=True, cwd=HOF, timeout=1800)
|
|
aus = r.stdout + r.stderr
|
|
t = re.search(r"(\d+) F\S+ in [\d.,]+s \| rot: (\d+)", aus) # Faelle / Faelle
|
|
if t:
|
|
return int(t.group(1)), int(t.group(2)), aus
|
|
rote = sum(1 for z in aus.splitlines() if "_spec.py" in z and "ROT" in z)
|
|
return 0, (rote if rote else -1), aus
|
|
|
|
|
|
def baue():
|
|
os.makedirs(HOF, exist_ok=True)
|
|
# OHNE neu ableiten: sonst ossifiziert die Liste (einmal rot, immer aus)
|
|
offen = os.path.join(HOF, "tests", "OHNE")
|
|
if os.path.exists(offen):
|
|
os.remove(offen)
|
|
kopiere_grundstock()
|
|
behalten, weg = waehle_pruefungen()
|
|
for n in os.listdir(os.path.join(HOF, "tests")):
|
|
if n.endswith("_spec.py"):
|
|
os.remove(os.path.join(HOF, "tests", n))
|
|
for n in behalten:
|
|
kopiere(os.path.join(WURZEL, "tests", n), os.path.join(HOF, "tests", n))
|
|
for r, t in (STORY_TEXTE_WELT if WELT else STORY_TEXTE).items():
|
|
ziel = os.path.join(HOF, r)
|
|
if not os.path.exists(ziel):
|
|
os.makedirs(os.path.dirname(ziel) or HOF, exist_ok=True)
|
|
open(ziel, "w", encoding="utf-8").write(t)
|
|
still = [n for n in genannte_pruefungen() if not os.path.exists(os.path.join(HOF, "tests", n))]
|
|
for n in still:
|
|
kopiere(os.path.join(WURZEL, "tests", n), os.path.join(HOF, "tests", n))
|
|
faelle, rot, aus = lauf()
|
|
geholt = []
|
|
for _ in range(5): # fehlt ein Modul, holen
|
|
fehlend = [n for n in fehlende_module(aus) if quelle_fuer(n)[0]]
|
|
if not fehlend:
|
|
break
|
|
for n in fehlend:
|
|
d, name = quelle_fuer(n)
|
|
kopiere(os.path.join(WURZEL, d, name + ".py"), os.path.join(HOF, d, name + ".py"))
|
|
geholt.append(f"{d}/{name}.py")
|
|
faelle, rot, aus = lauf()
|
|
ausgelassen = []
|
|
for _ in range(3): # was dann noch rot ist, braucht mehr als der Hof hat
|
|
rote = [z.split()[0] for z in aus.splitlines() if "ROT" in z]
|
|
if not rote:
|
|
break
|
|
offen = os.path.join(HOF, "tests", "OHNE")
|
|
alt_ohne = set(open(offen, encoding="utf-8").read().split()) if os.path.exists(offen) else set()
|
|
with open(offen, "w", encoding="utf-8") as h:
|
|
for n in sorted(alt_ohne | set(rote)):
|
|
h.write(n + "\n")
|
|
ausgelassen = sorted(alt_ohne | set(rote))
|
|
faelle, rot, aus = lauf()
|
|
print(f"Hof: {len(behalten)} Pruefungen gewaehlt, {len(weg)} draussen, {len(still)} stille, "
|
|
f"{len(geholt)} nachgezogen -> {faelle} Faelle, rot {rot}")
|
|
if rot:
|
|
print(" rot: " + " ".join(z.split()[0] for z in aus.splitlines() if "ROT" in z))
|
|
if ausgelassen:
|
|
print(f" nur als Datei (brauchen mehr als der Hof hat): {' '.join(ausgelassen)}")
|
|
schreibe_stand()
|
|
bericht()
|
|
uebernahme_stand()
|
|
git_sichern()
|
|
|
|
|
|
def schreibe_stand():
|
|
stand = {r: sha(os.path.join(HOF, r)) for r in liste(HOF) if r not in STORY}
|
|
os.makedirs(os.path.dirname(STAND), exist_ok=True)
|
|
with open(STAND, "w", encoding="utf-8") as h:
|
|
json.dump({"hof": HOF, "dateien": stand}, h, indent=1, sort_keys=True)
|
|
|
|
|
|
def uebernahme_stand():
|
|
"""Nach dem Bau sind Hof und Baum identisch - Konflikte koennen erst danach entstehen."""
|
|
return None
|
|
|
|
|
|
def git_sichern():
|
|
frisch = not os.path.isdir(os.path.join(HOF, ".git"))
|
|
if frisch:
|
|
subprocess.run(["git", "init", "-q"], cwd=HOF, check=False)
|
|
subprocess.run(["git", "-C", HOF, "add", "-A"], check=False)
|
|
subprocess.run(["git", "-C", HOF, "commit", "-q", "--allow-empty",
|
|
"-m", "Erster Stand" if frisch else "Stand"], check=False)
|
|
|
|
|
|
# ---------------------------------------------------------------- uebernehmen
|
|
|
|
def uebernehmen(schreiben=True):
|
|
if not os.path.exists(STAND):
|
|
print("kein Stand - erst bauen"); return
|
|
stand = json.load(open(STAND, encoding="utf-8"))["dateien"]
|
|
tun, konflikt, neu, entfernt = [], [], [], []
|
|
for r in liste(HOF):
|
|
if r in STORY:
|
|
continue
|
|
q = os.path.join(WURZEL, r)
|
|
if not os.path.exists(q):
|
|
neu.append(r)
|
|
elif sha(q) == sha(os.path.join(HOF, r)):
|
|
continue
|
|
elif r not in stand or sha(os.path.join(HOF, r)) != stand[r]:
|
|
(konflikt if r in stand and sha(q) != stand[r] else tun).append(r)
|
|
for r in stand:
|
|
if not os.path.exists(os.path.join(HOF, r)):
|
|
entfernt.append(r)
|
|
print(f"Uebernahme: {len(tun)} uebernehmen, {len(neu)} neu, {len(konflikt)} Konflikt, "
|
|
f"{len(entfernt)} im Hof entfernt")
|
|
for r in tun + neu:
|
|
a = text(os.path.join(WURZEL, r)).splitlines() if os.path.exists(os.path.join(WURZEL, r)) else []
|
|
b = text(os.path.join(HOF, r)).splitlines()
|
|
d = list(difflib.unified_diff(a, b, "unser/" + r, "hof/" + r, lineterm="", n=0))
|
|
print("\n".join(d[:20]))
|
|
if schreiben:
|
|
kopiere(os.path.join(HOF, r), os.path.join(WURZEL, r))
|
|
for r in konflikt:
|
|
print(f" Konflikt (beide Seiten geaendert, nichts geschrieben): {r}")
|
|
for r in entfernt:
|
|
print(f" im Hof entfernt (echter Baum behaelt sie): {r}")
|
|
if schreiben and not konflikt:
|
|
schreibe_stand()
|
|
|
|
|
|
def main():
|
|
was = (sys.argv[1:] or ["--bericht"])[0]
|
|
if was == "--bauen":
|
|
baue()
|
|
elif was == "--bericht":
|
|
return 1 if bericht() else 0
|
|
elif was == "--zeigen":
|
|
uebernehmen(schreiben=False)
|
|
elif was == "--uebernehmen":
|
|
uebernehmen(schreiben=True)
|
|
else:
|
|
print(__doc__)
|
|
return 1
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|