GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — scpn-control/streamlit_app.py at main · anulum/scpn-control

Expand file tree

/

streamlit_app.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
65 lines (50 loc) · 1.96 KB
/

streamlit_app.py

Copy path

File metadata and controls

65 lines (50 loc) · 1.96 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# SPDX-License-Identifier: AGPL-3.0-or-later
# Commercial license available
# © Concepts 1996–2026 Miroslav Šotek. All rights reserved.
# © Code 2020–2026 Miroslav Šotek. All rights reserved.
# ORCID: 0009-0009-3560-0851
# Contact: www.anulum.li | [email protected]
# SCPN Control — Streamlit Cloud entry point.
"""Root Streamlit Cloud entry point for the live phase dashboard.
Streamlit Cloud expects a repository-root script. The production dashboard logic
already lives in ``examples/streamlit_ws_client.py`` so local users and the cloud
deployment exercise the same WebSocket client code path. With no explicit
arguments this adapter starts that client in embedded-server mode.
"""
from __future__ import annotations
import runpy
import sys
from collections.abc import Sequence
from pathlib import Path
APP_PATH = Path(__file__).resolve().parent / "examples" / "streamlit_ws_client.py"
DEFAULT_ARGS = ("--embedded",)
def streamlit_cloud_args(argv: Sequence[str]) -> list[str]:
"""Return arguments for the delegated Streamlit dashboard.
Parameters
----------
argv
Arguments passed after ``streamlit run streamlit_app.py --``.
Returns
-------
list[str]
Explicit arguments when supplied, otherwise the embedded-server default
required by Streamlit Cloud.
"""
return list(argv) if argv else list(DEFAULT_ARGS)
def main(argv: Sequence[str] | None = None) -> None:
"""Run the existing Streamlit WebSocket client through the root entry point.
Parameters
----------
argv
Optional dashboard arguments. When omitted, command-line arguments after
the root script are forwarded.
"""
app_args = streamlit_cloud_args(sys.argv[1:] if argv is None else argv)
previous_argv = sys.argv[:]
try:
sys.argv = [str(APP_PATH), *app_args]
runpy.run_path(str(APP_PATH), run_name="__main__")
finally:
sys.argv = previous_argv
if __name__ == "__main__":
main()
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.