Skip to content

Commit 508c0b1

Browse files
committed
uupdates
1 parent 63d8790 commit 508c0b1

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

examples/todo_series/intermediate/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __ft__(self:Todo):
4040

4141
return Card(DivLAligned(done,
4242
style(Strong(self.title, target_id='current-todo')),
43-
style(P(due_date,cls=TextFont.muted_sm)),
43+
style(P(due_date,cls=TextPresets.muted_sm)),
4444
edit,
4545
delete),
4646
id=tid(self.id))

main.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ def NavBar(dir_path, info=True, active=''):
3838

3939
@app.get('/split/{category}/{project}')
4040
def split_view(category: str, project: str):
41-
dir_path = Path('examples')/category/project
42-
code_text = (dir_path/'app.py').read_text().strip()
43-
info = (dir_path/'info.md').exists()
41+
try:
42+
dir_path = Path('examples')/category/project
43+
code_text = (dir_path/'app.py').read_text().strip()
44+
info = (dir_path/'info.md').exists()
45+
except:
46+
return Response(status_code=404)
4447
return (
4548
NavBar(dir_path, info=info, active='split'),
4649
Title(f"{dir_path.name} - Split View"),
@@ -50,15 +53,21 @@ def split_view(category: str, project: str):
5053

5154
@app.get('/code/{category}/{project}')
5255
def application_code(category:str, project:str):
53-
dir_path = Path('examples')/category/project
54-
code_text = (dir_path/'app.py').read_text().strip()
55-
info = (dir_path/'info.md').exists()
56+
try:
57+
dir_path = Path('examples')/category/project
58+
code_text = (dir_path/'app.py').read_text().strip()
59+
info = (dir_path/'info.md').exists()
60+
except:
61+
return Response(status_code=404)
5662
return (NavBar(dir_path, info=info, active='code'), Title(f"{dir_path.name} - Code"), Container(Pre(Code(code_text, cls='language-python'))))
5763

5864
@app.get('/info/{category}/{project}')
5965
def application_info(category:str, project:str):
60-
dir_path = Path('examples')/category/project
61-
md_text = (dir_path/'info.md').read_text()
66+
try:
67+
dir_path = Path('examples')/category/project
68+
md_text = (dir_path/'info.md').read_text()
69+
except:
70+
return Response(status_code=404)
6271
return (NavBar(dir_path, info=True, active='info'), Title(f"{dir_path.name} - Info"), Container(render_md(md_text)))
6372

6473
def ImageCard(dir_path):

0 commit comments

Comments
 (0)