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: with sys.stdin as f:
while True: while True:
head = f.readline() line = f.readline()
if not head: if not line:
break break
if in_header == True: if in_header == True:
if head.startswith("## "): if line.startswith("## "):
in_header = False in_header = False
else: else:
continue continue
if head.startswith("## "): if line.startswith("## "):
name = head.split("## ")[1] name = line.split("## ")[1]
name = f"dnscry.pt-{name}".replace(" ", "") name = f"dnscry.pt-{name}".replace(" ", "")
print(f"## {name}") print(f"## {name}")
else: else:
print(head) print(line)

View File

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

View File

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