From 01a0e865c865b986f2a8b9cbd6eeedf79120bf74 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 21 Nov 2024 17:08:05 -0800 Subject: [PATCH] Allow for license to have a .txt extension --- notebook/process_notebook.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/notebook/process_notebook.py b/notebook/process_notebook.py index 2ce21bb..d8b2902 100755 --- a/notebook/process_notebook.py +++ b/notebook/process_notebook.py @@ -654,11 +654,12 @@ def get_page_map(): def get_license(): - fname = os.path.join(TOPDIR, 'LICENSE') - if not os.path.exists(fname): - return b'' - with open(fname, 'rb') as fh: - return fh.read() + for fname in ('LICENSE', 'LICENSE.txt'): + full_fname = os.path.join(TOPDIR, fname) + if os.path.exists(full_fname): + with open(full_fname, 'rb') as fh: + return fh.read() + return b'' def get_license_link():