Skip to content

Commit 7a7fbea

Browse files
committed
edited error.html text
1 parent 5cad4dd commit 7a7fbea

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

python-web-io/python_web_io/main.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ async def lifespan(app: FastAPI):
111111
observer.stop()
112112
observer.join()
113113

114+
114115
app = FastAPI(lifespan=lifespan)
115116
app.secret_key = os.getenv("PYTHONWEBIO_SECRET_KEY", "")
116117
app.state.cli_script_config = None
@@ -306,21 +307,35 @@ async def http_exception_handler(request: Request, exc: HTTPException):
306307
If running python_web_io/main.py directly (instead of via uvicorn with an entrypoint), accept CLI arguments.
307308
Ideal for quickly testing capabilities without creating `.envrc` or `.pythonwebio/config.toml` files.
308309
"""
309-
310+
310311
import argparse
311312
import uvicorn
312313

313314
def parse_command_line_arguments():
314315
parser = argparse.ArgumentParser()
315-
parser.add_argument("--script", type=str, default="default_value1", help="Set the python script (override `config.toml` settings) (format: e.g.:`path/to/file.py:main`).")
316-
parser.add_argument("--config", type=str, default=".pythonwebio/config.toml", help="Set the `config.toml` filepath directly (default: `.pythonwebio/config.toml`).")
317-
parser.add_argument("--host", type=str, default="localhost", help="Host for uvicorn server.")
318-
parser.add_argument("--port", type=int, default=8000, help="Port for uvicorn server.")
316+
parser.add_argument(
317+
"--script",
318+
type=str,
319+
default="default_value1",
320+
help="Set the python script (override `config.toml` settings) (format: e.g.:`path/to/file.py:main`).",
321+
)
322+
parser.add_argument(
323+
"--config",
324+
type=str,
325+
default=".pythonwebio/config.toml",
326+
help="Set the `config.toml` filepath directly (default: `.pythonwebio/config.toml`).",
327+
)
328+
parser.add_argument(
329+
"--host", type=str, default="localhost", help="Host for uvicorn server."
330+
)
331+
parser.add_argument(
332+
"--port", type=int, default=8000, help="Port for uvicorn server."
333+
)
319334
return parser.parse_args()
320335

321336
# Read command-line arguments and set app.state values
322337
args = parse_command_line_arguments()
323338
app.state.cli_script_config = args.script
324339
app.state.config_path = args.config
325340

326-
uvicorn.run(app, host=args.host, port=args.port)
341+
uvicorn.run(app, host=args.host, port=args.port)

python-web-io/python_web_io/templates/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block content %}
44
<h1>{{status_code}}: {{detail}}</h1>
55
<hr>
6-
<p>The server has unfortunately forgotten your form progress. Try these steps to fix the issue.</p>
6+
<p>The server has unfortunately forgotten your form progress. Try these steps to get back on track:</p>
77
<ol>
88
<li>Reload the website.</li>
99
<li>Check this website is only open in one tab.</li>

0 commit comments

Comments
 (0)