Auto-format Python files with black

This patch is strictly the result of:
$ black $(git ls-files '*.py')

There have been no manual changes.
This commit is contained in:
Tom Krizek
2022-06-07 16:27:23 +02:00
parent 5d2b7cab08
commit c9cb8ae9eb
36 changed files with 1520 additions and 908 deletions

View File

@@ -76,20 +76,20 @@ PATH = re.compile(TOP + "/")
S = State()
with open(sys.argv[1], "r", encoding='utf-8') as f:
with open(sys.argv[1], "r", encoding="utf-8") as f:
for line in f.readlines():
if line == "==================\n":
if not S.inside:
S.inside = True
else:
DNAME = sha256(S.last_line.encode('utf-8')).hexdigest()
DNAME = sha256(S.last_line.encode("utf-8")).hexdigest()
DNAME = os.path.join(OUT, DNAME)
if not os.path.isdir(DNAME):
os.mkdir(DNAME)
FNAME = sha256(S.block.encode('utf-8')).hexdigest() + ".txt"
FNAME = sha256(S.block.encode("utf-8")).hexdigest() + ".txt"
FNAME = os.path.join(DNAME, FNAME)
if not os.path.isfile(FNAME):
with open(FNAME, "w", encoding='utf-8') as w:
with open(FNAME, "w", encoding="utf-8") as w:
w.write(S.block)
S.reset()
else: