Skip to content

Commit c5c2eb5

Browse files
authored
Merge pull request #1 from KevinArce/sourcery/master
Sourcery refactored master branch
2 parents d662314 + ba47765 commit c5c2eb5

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tools/generate_contents.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ def get_notebook_title(nb_file):
2828

2929
def gen_contents(directory=None):
3030
for nb in iter_notebooks():
31-
if directory:
32-
nb_url = os.path.join(directory, nb)
33-
else:
34-
nb_url = nb
31+
nb_url = os.path.join(directory, nb) if directory else nb
3532
chapter, section, title = REG.match(nb).groups()
3633
title = get_notebook_title(nb)
3734
if section == '00':

website/copy_notebooks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def copy_notebooks():
9898

9999
nbformat.write(content, os.path.join(NB_DEST_DIR, nb))
100100

101-
pagefile = os.path.join(PAGE_DEST_DIR, base + '.md')
102-
htmlfile = base.lower() + '.html'
101+
pagefile = os.path.join(PAGE_DEST_DIR, f'{base}.md')
102+
htmlfile = f'{base.lower()}.html'
103103
with open(pagefile, 'w') as f:
104104
f.write(PAGEFILE.format(title=title,
105105
htmlfile=htmlfile,

0 commit comments

Comments
 (0)