Rename "head" to "line"

This commit is contained in:
Frank Denis 2024-09-19 06:41:17 +02:00
parent 1f51996f91
commit c1af5a7704
3 changed files with 15 additions and 15 deletions

View File

@ -9,17 +9,17 @@ in_header = True
with sys.stdin as f:
while True:
head = f.readline()
if not head:
line = f.readline()
if not line:
break
if in_header == True:
if head.startswith("## "):
if line.startswith("## "):
in_header = False
else:
continue
if head.startswith("## "):
name = head.split("## ")[1]
if line.startswith("## "):
name = line.split("## ")[1]
name = f"dnscry.pt-{name}".replace(" ", "")
print(f"## {name}")
else:
print(head)
print(line)

View File

@ -9,17 +9,17 @@ in_header = True
with sys.stdin as f:
while True:
head = f.readline()
if not head:
line = f.readline()
if not line:
break
if in_header == True:
if head.startswith("## "):
if line.startswith("## "):
in_header = False
else:
continue
if head.startswith("## "):
name = head.split("## ")[1]
if line.startswith("## "):
name = line.split("## ")[1]
name = f"dnscry.pt-{name}".replace(" ", "")
print(f"## {name}")
else:
print(head)
print(line)

View File

@ -20,10 +20,10 @@ servers = {}
with sys.stdin as f:
while True:
head = f.readline()
if head == "":
line = f.readline()
if line == "":
break
parts = head.strip().split("## ")
parts = line.strip().split("## ")
name = parts[1].strip()
description = f.readline().strip()
stamp = f.readline().strip()