Integrate claude, improve selenium and support qemu #1
1 changed files with 6 additions and 3 deletions
|
|
@ -1083,10 +1083,13 @@ class TODO:
|
||||||
if os.path.exists(cfg):
|
if os.path.exists(cfg):
|
||||||
with open(cfg, encoding="utf-8") as fh:
|
with open(cfg, encoding="utf-8") as fh:
|
||||||
existing = fh.read()
|
existing = fh.read()
|
||||||
# Retire un ancien bloc du même Host (jusqu'au prochain Host / EOF).
|
# Retire un ancien bloc du même Host (ses lignes indentées). Pas de
|
||||||
|
# drapeau DOTALL : « . » ne doit PAS traverser les sauts de ligne,
|
||||||
|
# sinon .* engloutirait tout jusqu'à la fin du fichier et effacerait
|
||||||
|
# les entrées suivantes.
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
rf"(?ms)^[ \t]*Host[ \t]+{re.escape(host)}[ \t]*\n"
|
rf"(?m)^[ \t]*Host[ \t]+{re.escape(host)}[ \t]*\n"
|
||||||
r"(?:[ \t]+.*\n?)*"
|
r"(?:[ \t]+[^\n]*\n?)*"
|
||||||
)
|
)
|
||||||
existing = pattern.sub("", existing).rstrip("\n")
|
existing = pattern.sub("", existing).rstrip("\n")
|
||||||
block = (
|
block = (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue