Skip to content

Commit ebede35

Browse files
committed
handle no images
1 parent 88711a0 commit ebede35

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deployment/installtutorials.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,18 @@ def process_repo(repo, destination_directory):
5757
print(f"Found tutorial(s) {tutorials}")
5858
for t in tutorials:
5959
shutil.copy(t, destination_directory)
60-
shutil.copy(f"{repo}/{os.path.splitext(os.path.basename(t))[0]}.html", destination_directory)
60+
shutil.copy(
61+
f"{repo}/{os.path.splitext(os.path.basename(t))[0]}.html",
62+
destination_directory,
63+
)
6164
if len(tutorials) > 1:
6265
print("More than 1 tutorial found; treating this as a book")
6366
shutil.copy(f"{repo}/index.html", destination_directory)
6467
# copy images (plots) in notebook for faster page loading
65-
shutil.copy(f"{repo}/_images/*.png", f"{destination_directory}/nboutput")
68+
try:
69+
shutil.copy(f"{repo}/_images/*.png", f"{destination_directory}/nboutput")
70+
except FileNotFoundError:
71+
pass
6672

6773

6874
if __name__ == "__main__":

0 commit comments

Comments
 (0)