Skip to content

Commit d7bc2d8

Browse files
mzuennimpsijm
authored andcommitted
less indent
1 parent 841d4f9 commit d7bc2d8

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

bin/export.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -334,20 +334,21 @@ def add_testcase(in_file: Path) -> None:
334334
if (export_dir / "statement").exists():
335335
(export_dir / "statement").rename(export_dir / "problem_statement")
336336
for d in ["solution", "problem_slide"]:
337-
if (export_dir / d).is_dir():
338-
for f in list(util.glob(problem.path, f"{d}/*")):
339-
if f.is_file():
340-
out = Path("problem_statement") / f.relative_to(problem.path / d)
341-
if out.exists():
342-
message(
343-
f"Can not export {f.relative_to(problem.path)} as {out}",
344-
"Zip",
345-
output,
346-
color_type=MessageType.WARN,
347-
)
348-
else:
349-
add_file(out, f)
350-
shutil.rmtree(export_dir / d)
337+
if not (export_dir / d).is_dir():
338+
continue
339+
for f in list(util.glob(problem.path, f"{d}/*")):
340+
if f.is_file():
341+
out = Path("problem_statement") / f.relative_to(problem.path / d)
342+
if out.exists():
343+
message(
344+
f"Can not export {f.relative_to(problem.path)} as {out}",
345+
"Zip",
346+
output,
347+
color_type=MessageType.WARN,
348+
)
349+
else:
350+
add_file(out, f)
351+
shutil.rmtree(export_dir / d)
351352

352353
# handle yaml updates
353354
yaml_path.unlink()

0 commit comments

Comments
 (0)