Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
91 lines (65 loc) · 2.5 KB
/
Copy pathmain.py
File metadata and controls
91 lines (65 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Museum Exhibit Studio - learner entrypoint.
#
# HOW TO EDIT THIS FILE
#
# Every place you write code is a named region between two marker lines:
#
# >>> BEGIN <region> | Step 4: INSERT | Step 6: REPLACE
# <<< END <region>
#
# The BEGIN line lists every step that touches the region. Each lesson block names its region
# and one of two actions:
#
# INSERT The region is empty. Paste the block between the two marker lines.
# REPLACE The region already has code. Delete everything between the marker lines,
# then paste the block.
#
# A block is always the complete contents of its region. Never edit, move, or delete a marker
# line, and leave the code outside the regions as it is.
#
# The pre-built curator helpers live in curator.py, and the system messages in
# system_messages.py. Do not edit those files: they are the application-owned half of the
# workshop, and they must stay identical to the finished app's copy.
# >>> BEGIN imports | Steps 1-7: REPLACE
from __future__ import annotations
import asyncio
import sys
from curator import describe_failure
# <<< END imports
# >>> BEGIN exhibit-prompt | Step 4: INSERT | Step 6: REPLACE
# <<< END exhibit-prompt
# >>> BEGIN html-prompt | Step 7: INSERT
# <<< END html-prompt
# >>> BEGIN generation-config | Step 4: INSERT | Step 6: REPLACE
# <<< END generation-config
# >>> BEGIN research-config | Step 6: INSERT
# <<< END research-config
# >>> BEGIN html-config | Step 7: INSERT
# <<< END html-config
# >>> BEGIN session-runner | Step 4: INSERT
# <<< END session-runner
async def main() -> int:
try:
# >>> BEGIN banner | Step 1: REPLACE
print("=== Museum Exhibit Studio starter ===")
print("Pre-built curator helpers are ready in curator.py.")
print("Continue with museum step 1 to write your first curator session.")
# <<< END banner
# >>> BEGIN choose-facts | Step 4: INSERT
# <<< END choose-facts
# >>> BEGIN research | Step 6: INSERT
# <<< END research
# >>> BEGIN generate | Step 1: INSERT | Steps 2-6: REPLACE
# <<< END generate
# >>> BEGIN validate | Step 5: INSERT
# <<< END validate
# >>> BEGIN sources | Step 6: INSERT
# <<< END sources
# >>> BEGIN exhibit-page | Step 7: INSERT
# <<< END exhibit-page
return 0
except Exception as error:
print(describe_failure(error), file=sys.stderr)
return 1
if __name__ == "__main__":
raise SystemExit(asyncio.run(main()))