streamlit-nightly 1.44.2.dev20250422__py3-none-any.whl → 1.44.2.dev20250424__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/commands/navigation.py +2 -1
- streamlit/elements/alert.py +67 -0
- streamlit/elements/exception.py +28 -3
- streamlit/elements/lib/layout_utils.py +51 -0
- streamlit/errors.py +15 -0
- streamlit/proto/Alert_pb2.py +6 -5
- streamlit/proto/Alert_pb2.pyi +9 -1
- streamlit/proto/Exception_pb2.py +4 -3
- streamlit/proto/Exception_pb2.pyi +9 -1
- streamlit/proto/MetricsEvent_pb2.py +4 -4
- streamlit/proto/MetricsEvent_pb2.pyi +4 -1
- streamlit/proto/WidthConfig_pb2.py +27 -0
- streamlit/proto/WidthConfig_pb2.pyi +34 -0
- streamlit/runtime/context.py +61 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.Bp2ldccU.js → ErrorOutline.esm.kwxUkJiQ.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BFGQMqxg.js → FileDownload.esm.B4NSS6Sl.js} +1 -1
- streamlit/static/static/js/{FileHelper.CLfR2Nl5.js → FileHelper.D70RJhDu.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DN7_Z3pK.js → FormClearHelper.C-xLj6rB.js} +1 -1
- streamlit/static/static/js/{Hooks.Dr0GH325.js → Hooks.BB7DtXCF.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BmCPiwuH.js → InputInstructions.CGY1oTmu.js} +1 -1
- streamlit/static/static/js/{ProgressBar.C1S12VpK.js → ProgressBar.BMrZcYD1.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.CfxGSPro.js → RenderInPortalIfExists.C7BYLlpF.js} +1 -1
- streamlit/static/static/js/{Toolbar.BMxjLFs_.js → Toolbar.JI3o5o7J.js} +1 -1
- streamlit/static/static/js/{base-input.BLpJZP2E.js → base-input.ppk9zgs1.js} +1 -1
- streamlit/static/static/js/{checkbox.CIgBIQZk.js → checkbox.49raiX_Q.js} +1 -1
- streamlit/static/static/js/{createSuper.DBgOP3Du.js → createSuper.87fVAqEV.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CSVlRStP.js → data-grid-overlay-editor.B1NKPOjN.js} +1 -1
- streamlit/static/static/js/{downloader.B2XHI8Rs.js → downloader.BcfN0KsR.js} +1 -1
- streamlit/static/static/js/{es6.Dopsw67W.js → es6.SM-d8IW7.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.C85rYpfO.js → iframeResizer.contentWindow.BiLXSNCc.js} +1 -1
- streamlit/static/static/js/{index.BV4FE5kB.js → index.-XsjpKIw.js} +1 -1
- streamlit/static/static/js/{index.D4vkE8k4.js → index.23z_CL39.js} +1 -1
- streamlit/static/static/js/{index.6uvkM5kA.js → index.B5QZmtKU.js} +1 -1
- streamlit/static/static/js/{index.9mIvDHDJ.js → index.BHUccop_.js} +1 -1
- streamlit/static/static/js/{index.BpYJxTkk.js → index.BJXqcYGa.js} +119 -119
- streamlit/static/static/js/{index.BiV4F66u.js → index.BK6Q5McP.js} +1 -1
- streamlit/static/static/js/{index.CZ-a2zEe.js → index.BMHV-2Ba.js} +1 -1
- streamlit/static/static/js/{index.C56IkBvU.js → index.BMkGp3A8.js} +1 -1
- streamlit/static/static/js/{index.CSVdq4RM.js → index.BWA7mhkD.js} +5 -5
- streamlit/static/static/js/{index.C2MtHl98.js → index.BbUIsbcG.js} +1 -1
- streamlit/static/static/js/{index.CCYDqcpA.js → index.BlguKOUW.js} +1 -1
- streamlit/static/static/js/{index.CrSmh1fy.js → index.BpwS_2vg.js} +1 -1
- streamlit/static/static/js/{index.BwyCju0E.js → index.Bpzbt0XE.js} +1 -1
- streamlit/static/static/js/{index.DN3zE0RU.js → index.BtSh2qF2.js} +1 -1
- streamlit/static/static/js/{index.DMSrAr4X.js → index.C555txyo.js} +1 -1
- streamlit/static/static/js/{index.C7p03y_M.js → index.C5lCQ63O.js} +1 -1
- streamlit/static/static/js/{index.DYVqVcRM.js → index.CCSljmFB.js} +1 -1
- streamlit/static/static/js/{index.Bpd8CsZ5.js → index.CWgDSgiP.js} +1 -1
- streamlit/static/static/js/{index.BVHpAfQR.js → index.CgJwml-l.js} +1 -1
- streamlit/static/static/js/{index.CWB411xq.js → index.Chh_6WO_.js} +1 -1
- streamlit/static/static/js/{index.p0aNteOo.js → index.CpYhueoB.js} +1 -1
- streamlit/static/static/js/{index.DPcAZ75a.js → index.Cs0BKVkf.js} +1 -1
- streamlit/static/static/js/{index.Kw3W98Th.js → index.Cu7GDmYZ.js} +1 -1
- streamlit/static/static/js/{index.PNpPr6uJ.js → index.CyYnsaI7.js} +1 -1
- streamlit/static/static/js/{index.DZxZM7Ek.js → index.DKW03_hE.js} +1 -1
- streamlit/static/static/js/{index.Bpy9n229.js → index.DOW8qES0.js} +1 -1
- streamlit/static/static/js/{index.q8SJCyGp.js → index.DOfuaf_0.js} +1 -1
- streamlit/static/static/js/{index.BL3Kr9Rq.js → index.DQ8pk-Cx.js} +1 -1
- streamlit/static/static/js/{index.HAb52J76.js → index.D_eW5hqT.js} +1 -1
- streamlit/static/static/js/{index.CCX5EIu8.js → index.DdB-Sih0.js} +1 -1
- streamlit/static/static/js/{index.DeS0IkWE.js → index.DmyMOJie.js} +1 -1
- streamlit/static/static/js/{index.3HfBohwS.js → index.DyvfAcMU.js} +1 -1
- streamlit/static/static/js/{index.DojXbCby.js → index.Gze6P7P8.js} +1 -1
- streamlit/static/static/js/{index.DN_7WvH0.js → index.esYPLQWk.js} +1 -1
- streamlit/static/static/js/{index.DoribfgZ.js → index.tXJ66r45.js} +1 -1
- streamlit/static/static/js/{index.C00os7bA.js → index.tz3no0C-.js} +1 -1
- streamlit/static/static/js/{index.CEWxPngV.js → index.vUKKnPLN.js} +1 -1
- streamlit/static/static/js/{input.CCoe_psd.js → input.B1adH3Tq.js} +1 -1
- streamlit/static/static/js/{memory.DJlUxbbU.js → memory._j_IEh4p.js} +1 -1
- streamlit/static/static/js/{mergeWith.BIF_NZCa.js → mergeWith.CaxCG68D.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.V-rRAT06.js → number-overlay-editor.CQ4il8-u.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DJfAQe4D.js → possibleConstructorReturn.BeSJyC-R.js} +1 -1
- streamlit/static/static/js/{sandbox.Dg0KTNPN.js → sandbox.CJ8UEQ_8.js} +1 -1
- streamlit/static/static/js/{textarea.D3KTVlzD.js → textarea.BoKsAt5U.js} +1 -1
- streamlit/static/static/js/{timepicker.Bz2YVuxL.js → timepicker.zqbF1i9c.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.B93v6_qJ.js → toConsumableArray.BlqVQ7Zt.js} +1 -1
- streamlit/static/static/js/{uniqueId.Binq0oUN.js → uniqueId.CB2jSt-Y.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.CvULcwlh.js → useBasicWidgetState.CCJRj7uP.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CuQA4gaj.js → useOnInputChange.Cgjf7qmr.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.RQKRDDEV.js → withFullScreenWrapper.B-OvwjED.js} +1 -1
- {streamlit_nightly-1.44.2.dev20250422.dist-info → streamlit_nightly-1.44.2.dev20250424.dist-info}/METADATA +2 -2
- {streamlit_nightly-1.44.2.dev20250422.dist-info → streamlit_nightly-1.44.2.dev20250424.dist-info}/RECORD +87 -84
- {streamlit_nightly-1.44.2.dev20250422.dist-info → streamlit_nightly-1.44.2.dev20250424.dist-info}/WHEEL +1 -1
- {streamlit_nightly-1.44.2.dev20250422.data → streamlit_nightly-1.44.2.dev20250424.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.44.2.dev20250422.dist-info → streamlit_nightly-1.44.2.dev20250424.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.44.2.dev20250422.dist-info → streamlit_nightly-1.44.2.dev20250424.dist-info}/top_level.txt +0 -0
streamlit/commands/navigation.py
CHANGED
@@ -31,6 +31,7 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import (
|
|
31
31
|
ScriptRunContext,
|
32
32
|
get_script_run_ctx,
|
33
33
|
)
|
34
|
+
from streamlit.string_util import is_emoji
|
34
35
|
|
35
36
|
if TYPE_CHECKING:
|
36
37
|
from streamlit.source_util import PageHash, PageInfo
|
@@ -349,7 +350,7 @@ def _navigation(
|
|
349
350
|
p = msg.navigation.app_pages.add()
|
350
351
|
p.page_script_hash = page._script_hash
|
351
352
|
p.page_name = page.title
|
352
|
-
p.icon = page.icon
|
353
|
+
p.icon = f"emoji:{page.icon}" if is_emoji(page.icon) else page.icon
|
353
354
|
p.is_default = page._default
|
354
355
|
p.section_header = section_header
|
355
356
|
p.url_pathname = page.url_path
|
streamlit/elements/alert.py
CHANGED
@@ -16,12 +16,15 @@ from __future__ import annotations
|
|
16
16
|
|
17
17
|
from typing import TYPE_CHECKING, cast
|
18
18
|
|
19
|
+
from streamlit.elements.lib.layout_utils import validate_width
|
19
20
|
from streamlit.proto.Alert_pb2 import Alert as AlertProto
|
21
|
+
from streamlit.proto.WidthConfig_pb2 import WidthConfig
|
20
22
|
from streamlit.runtime.metrics_util import gather_metrics
|
21
23
|
from streamlit.string_util import clean_text, validate_icon_or_emoji
|
22
24
|
|
23
25
|
if TYPE_CHECKING:
|
24
26
|
from streamlit.delta_generator import DeltaGenerator
|
27
|
+
from streamlit.elements.lib.layout_utils import WidthWithoutContent
|
25
28
|
from streamlit.type_util import SupportsStr
|
26
29
|
|
27
30
|
|
@@ -32,6 +35,7 @@ class AlertMixin:
|
|
32
35
|
body: SupportsStr,
|
33
36
|
*, # keyword-only args:
|
34
37
|
icon: str | None = None,
|
38
|
+
width: WidthWithoutContent = "stretch",
|
35
39
|
) -> DeltaGenerator:
|
36
40
|
"""Display error message.
|
37
41
|
|
@@ -62,6 +66,9 @@ class AlertMixin:
|
|
62
66
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
63
67
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
64
68
|
font library.
|
69
|
+
width : int or "stretch"
|
70
|
+
The width of the alert. Can be either an integer (pixels) or "stretch".
|
71
|
+
Defaults to "stretch".
|
65
72
|
|
66
73
|
Example
|
67
74
|
-------
|
@@ -75,6 +82,18 @@ class AlertMixin:
|
|
75
82
|
alert_proto.icon = validate_icon_or_emoji(icon)
|
76
83
|
alert_proto.body = clean_text(body)
|
77
84
|
alert_proto.format = AlertProto.ERROR
|
85
|
+
|
86
|
+
validate_width(width)
|
87
|
+
|
88
|
+
width_config = WidthConfig()
|
89
|
+
|
90
|
+
if isinstance(width, int):
|
91
|
+
width_config.pixel_width = width
|
92
|
+
else:
|
93
|
+
width_config.use_stretch = True
|
94
|
+
|
95
|
+
alert_proto.width_config.CopyFrom(width_config)
|
96
|
+
|
78
97
|
return self.dg._enqueue("alert", alert_proto)
|
79
98
|
|
80
99
|
@gather_metrics("warning")
|
@@ -83,6 +102,7 @@ class AlertMixin:
|
|
83
102
|
body: SupportsStr,
|
84
103
|
*, # keyword-only args:
|
85
104
|
icon: str | None = None,
|
105
|
+
width: WidthWithoutContent = "stretch",
|
86
106
|
) -> DeltaGenerator:
|
87
107
|
"""Display warning message.
|
88
108
|
|
@@ -113,6 +133,9 @@ class AlertMixin:
|
|
113
133
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
114
134
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
115
135
|
font library.
|
136
|
+
width : int or "stretch"
|
137
|
+
The width of the alert. Can be either an integer (pixels) or "stretch".
|
138
|
+
Defaults to "stretch".
|
116
139
|
|
117
140
|
Example
|
118
141
|
-------
|
@@ -125,6 +148,18 @@ class AlertMixin:
|
|
125
148
|
alert_proto.body = clean_text(body)
|
126
149
|
alert_proto.icon = validate_icon_or_emoji(icon)
|
127
150
|
alert_proto.format = AlertProto.WARNING
|
151
|
+
|
152
|
+
validate_width(width)
|
153
|
+
|
154
|
+
width_config = WidthConfig()
|
155
|
+
|
156
|
+
if isinstance(width, int):
|
157
|
+
width_config.pixel_width = width
|
158
|
+
else:
|
159
|
+
width_config.use_stretch = True
|
160
|
+
|
161
|
+
alert_proto.width_config.CopyFrom(width_config)
|
162
|
+
|
128
163
|
return self.dg._enqueue("alert", alert_proto)
|
129
164
|
|
130
165
|
@gather_metrics("info")
|
@@ -133,6 +168,7 @@ class AlertMixin:
|
|
133
168
|
body: SupportsStr,
|
134
169
|
*, # keyword-only args:
|
135
170
|
icon: str | None = None,
|
171
|
+
width: WidthWithoutContent = "stretch",
|
136
172
|
) -> DeltaGenerator:
|
137
173
|
"""Display an informational message.
|
138
174
|
|
@@ -163,6 +199,9 @@ class AlertMixin:
|
|
163
199
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
164
200
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
165
201
|
font library.
|
202
|
+
width : int or "stretch"
|
203
|
+
The width of the alert. Can be either an integer (pixels) or "stretch".
|
204
|
+
Defaults to "stretch".
|
166
205
|
|
167
206
|
Example
|
168
207
|
-------
|
@@ -176,6 +215,18 @@ class AlertMixin:
|
|
176
215
|
alert_proto.body = clean_text(body)
|
177
216
|
alert_proto.icon = validate_icon_or_emoji(icon)
|
178
217
|
alert_proto.format = AlertProto.INFO
|
218
|
+
|
219
|
+
validate_width(width)
|
220
|
+
|
221
|
+
width_config = WidthConfig()
|
222
|
+
|
223
|
+
if isinstance(width, int):
|
224
|
+
width_config.pixel_width = width
|
225
|
+
else:
|
226
|
+
width_config.use_stretch = True
|
227
|
+
|
228
|
+
alert_proto.width_config.CopyFrom(width_config)
|
229
|
+
|
179
230
|
return self.dg._enqueue("alert", alert_proto)
|
180
231
|
|
181
232
|
@gather_metrics("success")
|
@@ -184,6 +235,7 @@ class AlertMixin:
|
|
184
235
|
body: SupportsStr,
|
185
236
|
*, # keyword-only args:
|
186
237
|
icon: str | None = None,
|
238
|
+
width: WidthWithoutContent = "stretch",
|
187
239
|
) -> DeltaGenerator:
|
188
240
|
"""Display a success message.
|
189
241
|
|
@@ -214,6 +266,9 @@ class AlertMixin:
|
|
214
266
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
215
267
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
216
268
|
font library.
|
269
|
+
width : int or "stretch"
|
270
|
+
The width of the alert. Can be either an integer (pixels) or "stretch".
|
271
|
+
Defaults to "stretch".
|
217
272
|
|
218
273
|
Example
|
219
274
|
-------
|
@@ -226,6 +281,18 @@ class AlertMixin:
|
|
226
281
|
alert_proto.body = clean_text(body)
|
227
282
|
alert_proto.icon = validate_icon_or_emoji(icon)
|
228
283
|
alert_proto.format = AlertProto.SUCCESS
|
284
|
+
|
285
|
+
validate_width(width)
|
286
|
+
|
287
|
+
width_config = WidthConfig()
|
288
|
+
|
289
|
+
if isinstance(width, int):
|
290
|
+
width_config.pixel_width = width
|
291
|
+
else:
|
292
|
+
width_config.use_stretch = True
|
293
|
+
|
294
|
+
alert_proto.width_config.CopyFrom(width_config)
|
295
|
+
|
229
296
|
return self.dg._enqueue("alert", alert_proto)
|
230
297
|
|
231
298
|
@property
|
streamlit/elements/exception.py
CHANGED
@@ -19,17 +19,20 @@ import traceback
|
|
19
19
|
from typing import TYPE_CHECKING, Callable, Final, TypeVar, cast
|
20
20
|
|
21
21
|
from streamlit import config
|
22
|
+
from streamlit.elements.lib.layout_utils import validate_width
|
22
23
|
from streamlit.errors import (
|
23
24
|
MarkdownFormattedException,
|
24
25
|
StreamlitAPIWarning,
|
25
26
|
)
|
26
27
|
from streamlit.logger import get_logger
|
27
28
|
from streamlit.proto.Exception_pb2 import Exception as ExceptionProto
|
29
|
+
from streamlit.proto.WidthConfig_pb2 import WidthConfig
|
28
30
|
from streamlit.runtime.metrics_util import gather_metrics
|
29
31
|
from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
|
30
32
|
|
31
33
|
if TYPE_CHECKING:
|
32
34
|
from streamlit.delta_generator import DeltaGenerator
|
35
|
+
from streamlit.elements.lib.layout_utils import WidthWithoutContent
|
33
36
|
|
34
37
|
_LOGGER: Final = get_logger(__name__)
|
35
38
|
|
@@ -40,7 +43,9 @@ _GENERIC_UNCAUGHT_EXCEPTION_TEXT: Final = "This app has encountered an error. Th
|
|
40
43
|
|
41
44
|
class ExceptionMixin:
|
42
45
|
@gather_metrics("exception")
|
43
|
-
def exception(
|
46
|
+
def exception(
|
47
|
+
self, exception: BaseException, width: WidthWithoutContent = "stretch"
|
48
|
+
) -> DeltaGenerator:
|
44
49
|
"""Display an exception.
|
45
50
|
|
46
51
|
In the lower-right corner of the exception, Streamlit displays links to
|
@@ -51,6 +56,9 @@ class ExceptionMixin:
|
|
51
56
|
----------
|
52
57
|
exception : Exception
|
53
58
|
The exception to display.
|
59
|
+
width : int or "stretch"
|
60
|
+
The width of the exception display. Can be either an integer (pixels) or "stretch".
|
61
|
+
Defaults to "stretch".
|
54
62
|
|
55
63
|
Example
|
56
64
|
-------
|
@@ -64,7 +72,7 @@ class ExceptionMixin:
|
|
64
72
|
height: 220px
|
65
73
|
|
66
74
|
"""
|
67
|
-
return _exception(self.dg, exception)
|
75
|
+
return _exception(self.dg, exception, width=width)
|
68
76
|
|
69
77
|
@property
|
70
78
|
def dg(self) -> DeltaGenerator:
|
@@ -77,16 +85,18 @@ class ExceptionMixin:
|
|
77
85
|
def _exception(
|
78
86
|
dg: DeltaGenerator,
|
79
87
|
exception: BaseException,
|
88
|
+
width: WidthWithoutContent = "stretch",
|
80
89
|
is_uncaught_app_exception: bool = False,
|
81
90
|
) -> DeltaGenerator:
|
82
91
|
exception_proto = ExceptionProto()
|
83
|
-
marshall(exception_proto, exception, is_uncaught_app_exception)
|
92
|
+
marshall(exception_proto, exception, width, is_uncaught_app_exception)
|
84
93
|
return dg._enqueue("exception", exception_proto)
|
85
94
|
|
86
95
|
|
87
96
|
def marshall(
|
88
97
|
exception_proto: ExceptionProto,
|
89
98
|
exception: BaseException,
|
99
|
+
width: WidthWithoutContent = "stretch",
|
90
100
|
is_uncaught_app_exception: bool = False,
|
91
101
|
) -> None:
|
92
102
|
"""Marshalls an Exception.proto message.
|
@@ -99,9 +109,15 @@ def marshall(
|
|
99
109
|
exception : BaseException
|
100
110
|
The exception whose data we're extracting.
|
101
111
|
|
112
|
+
width : int or "stretch"
|
113
|
+
The width of the exception display. Can be either an integer (pixels) or "stretch".
|
114
|
+
Defaults to "stretch".
|
115
|
+
|
102
116
|
is_uncaught_app_exception: bool
|
103
117
|
The exception originates from an uncaught error during script execution.
|
104
118
|
"""
|
119
|
+
validate_width(width)
|
120
|
+
|
105
121
|
is_markdown_exception = isinstance(exception, MarkdownFormattedException)
|
106
122
|
|
107
123
|
# Some exceptions (like UserHashError) have an alternate_name attribute so
|
@@ -116,6 +132,15 @@ def marshall(
|
|
116
132
|
exception_proto.stack_trace.extend(stack_trace)
|
117
133
|
exception_proto.is_warning = isinstance(exception, Warning)
|
118
134
|
|
135
|
+
width_config = WidthConfig()
|
136
|
+
|
137
|
+
if isinstance(width, int):
|
138
|
+
width_config.pixel_width = width
|
139
|
+
else:
|
140
|
+
width_config.use_stretch = True
|
141
|
+
|
142
|
+
exception_proto.width_config.CopyFrom(width_config)
|
143
|
+
|
119
144
|
try:
|
120
145
|
if isinstance(exception, SyntaxError):
|
121
146
|
# SyntaxErrors have additional fields (filename, text, lineno,
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from typing import Literal, Union
|
16
|
+
|
17
|
+
from typing_extensions import TypeAlias
|
18
|
+
|
19
|
+
from streamlit.errors import StreamlitInvalidWidthError
|
20
|
+
|
21
|
+
WidthWithoutContent: TypeAlias = Union[int, Literal["stretch"]]
|
22
|
+
Width: TypeAlias = Union[int, Literal["stretch", "content"]]
|
23
|
+
|
24
|
+
|
25
|
+
def validate_width(width: Width, allow_content: bool = False) -> None:
|
26
|
+
"""Validate the width parameter.
|
27
|
+
|
28
|
+
Parameters
|
29
|
+
----------
|
30
|
+
width : Any
|
31
|
+
The width value to validate.
|
32
|
+
allow_content : bool
|
33
|
+
Whether to allow "content" as a valid width value.
|
34
|
+
|
35
|
+
Raises
|
36
|
+
------
|
37
|
+
StreamlitInvalidWidthError
|
38
|
+
If the width value is invalid.
|
39
|
+
"""
|
40
|
+
if not isinstance(width, (int, str)):
|
41
|
+
raise StreamlitInvalidWidthError(width, allow_content)
|
42
|
+
|
43
|
+
if isinstance(width, str):
|
44
|
+
valid_strings = ["stretch"]
|
45
|
+
if allow_content:
|
46
|
+
valid_strings.append("content")
|
47
|
+
|
48
|
+
if width not in valid_strings:
|
49
|
+
raise StreamlitInvalidWidthError(width, allow_content)
|
50
|
+
elif width <= 0:
|
51
|
+
raise StreamlitInvalidWidthError(width, allow_content)
|
streamlit/errors.py
CHANGED
@@ -459,3 +459,18 @@ class StreamlitSecretNotFoundError(LocalizableStreamlitException, FileNotFoundEr
|
|
459
459
|
|
460
460
|
def __init__(self, message: str):
|
461
461
|
super().__init__(message)
|
462
|
+
|
463
|
+
|
464
|
+
class StreamlitInvalidWidthError(LocalizableStreamlitException):
|
465
|
+
"""Exception raised when an invalid width value is provided."""
|
466
|
+
|
467
|
+
def __init__(self, width: Any, allow_content: bool = False):
|
468
|
+
valid_values = "an integer (pixels) or 'stretch'"
|
469
|
+
if allow_content:
|
470
|
+
valid_values = "an integer (pixels), 'stretch', or 'content'"
|
471
|
+
|
472
|
+
super().__init__(
|
473
|
+
"Invalid width value: {width}. Width must be either {valid_values}.",
|
474
|
+
width=repr(width),
|
475
|
+
valid_values=valid_values,
|
476
|
+
)
|
streamlit/proto/Alert_pb2.py
CHANGED
@@ -12,9 +12,10 @@ from google.protobuf.internal import builder as _builder
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
13
13
|
|
14
14
|
|
15
|
+
from streamlit.proto import WidthConfig_pb2 as streamlit_dot_proto_dot_WidthConfig__pb2
|
15
16
|
|
16
17
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Alert.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Alert.proto\x1a!streamlit/proto/WidthConfig.proto\"\xb5\x01\n\x05\x41lert\x12\x0c\n\x04\x62ody\x18\x01 \x01(\t\x12\x1d\n\x06\x66ormat\x18\x02 \x01(\x0e\x32\r.Alert.Format\x12\x0c\n\x04icon\x18\x03 \x01(\t\x12,\n\x0cwidth_config\x18\x04 \x01(\x0b\x32\x16.streamlit.WidthConfig\"C\n\x06\x46ormat\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x45RROR\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\x0b\n\x07SUCCESS\x10\x04\x42*\n\x1c\x63om.snowflake.apps.streamlitB\nAlertProtob\x06proto3')
|
18
19
|
|
19
20
|
_globals = globals()
|
20
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -22,8 +23,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Alert_pb2',
|
|
22
23
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\nAlertProto'
|
25
|
-
_globals['_ALERT']._serialized_start=
|
26
|
-
_globals['_ALERT']._serialized_end=
|
27
|
-
_globals['_ALERT_FORMAT']._serialized_start=
|
28
|
-
_globals['_ALERT_FORMAT']._serialized_end=
|
26
|
+
_globals['_ALERT']._serialized_start=67
|
27
|
+
_globals['_ALERT']._serialized_end=248
|
28
|
+
_globals['_ALERT_FORMAT']._serialized_start=181
|
29
|
+
_globals['_ALERT_FORMAT']._serialized_end=248
|
29
30
|
# @@protoc_insertion_point(module_scope)
|
streamlit/proto/Alert_pb2.pyi
CHANGED
@@ -21,6 +21,7 @@ import builtins
|
|
21
21
|
import google.protobuf.descriptor
|
22
22
|
import google.protobuf.internal.enum_type_wrapper
|
23
23
|
import google.protobuf.message
|
24
|
+
import streamlit.proto.WidthConfig_pb2
|
24
25
|
import sys
|
25
26
|
import typing
|
26
27
|
|
@@ -74,17 +75,24 @@ class Alert(google.protobuf.message.Message):
|
|
74
75
|
BODY_FIELD_NUMBER: builtins.int
|
75
76
|
FORMAT_FIELD_NUMBER: builtins.int
|
76
77
|
ICON_FIELD_NUMBER: builtins.int
|
78
|
+
WIDTH_CONFIG_FIELD_NUMBER: builtins.int
|
77
79
|
body: builtins.str
|
78
80
|
"""Content to display."""
|
79
81
|
format: global___Alert.Format.ValueType
|
80
82
|
icon: builtins.str
|
83
|
+
@property
|
84
|
+
def width_config(self) -> streamlit.proto.WidthConfig_pb2.WidthConfig:
|
85
|
+
"""Indicates the width setting: "stetch", "content" or a pixel value."""
|
86
|
+
|
81
87
|
def __init__(
|
82
88
|
self,
|
83
89
|
*,
|
84
90
|
body: builtins.str = ...,
|
85
91
|
format: global___Alert.Format.ValueType = ...,
|
86
92
|
icon: builtins.str = ...,
|
93
|
+
width_config: streamlit.proto.WidthConfig_pb2.WidthConfig | None = ...,
|
87
94
|
) -> None: ...
|
88
|
-
def
|
95
|
+
def HasField(self, field_name: typing.Literal["width_config", b"width_config"]) -> builtins.bool: ...
|
96
|
+
def ClearField(self, field_name: typing.Literal["body", b"body", "format", b"format", "icon", b"icon", "width_config", b"width_config"]) -> None: ...
|
89
97
|
|
90
98
|
global___Alert = Alert
|
streamlit/proto/Exception_pb2.py
CHANGED
@@ -12,9 +12,10 @@ from google.protobuf.internal import builder as _builder
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
13
13
|
|
14
14
|
|
15
|
+
from streamlit.proto import WidthConfig_pb2 as streamlit_dot_proto_dot_WidthConfig__pb2
|
15
16
|
|
16
17
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Exception.proto\"
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Exception.proto\x1a!streamlit/proto/WidthConfig.proto\"\x9e\x01\n\tException\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x1b\n\x13message_is_markdown\x18\x04 \x01(\x08\x12\x13\n\x0bstack_trace\x18\x03 \x03(\t\x12\x12\n\nis_warning\x18\x05 \x01(\x08\x12,\n\x0cwidth_config\x18\x06 \x01(\x0b\x32\x16.streamlit.WidthConfigB.\n\x1c\x63om.snowflake.apps.streamlitB\x0e\x45xceptionProtob\x06proto3')
|
18
19
|
|
19
20
|
_globals = globals()
|
20
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -22,6 +23,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Exception_p
|
|
22
23
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\016ExceptionProto'
|
25
|
-
_globals['_EXCEPTION']._serialized_start=
|
26
|
-
_globals['_EXCEPTION']._serialized_end=
|
26
|
+
_globals['_EXCEPTION']._serialized_start=71
|
27
|
+
_globals['_EXCEPTION']._serialized_end=229
|
27
28
|
# @@protoc_insertion_point(module_scope)
|
@@ -22,6 +22,7 @@ import collections.abc
|
|
22
22
|
import google.protobuf.descriptor
|
23
23
|
import google.protobuf.internal.containers
|
24
24
|
import google.protobuf.message
|
25
|
+
import streamlit.proto.WidthConfig_pb2
|
25
26
|
import typing
|
26
27
|
|
27
28
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
@@ -42,6 +43,7 @@ class Exception(google.protobuf.message.Message):
|
|
42
43
|
MESSAGE_IS_MARKDOWN_FIELD_NUMBER: builtins.int
|
43
44
|
STACK_TRACE_FIELD_NUMBER: builtins.int
|
44
45
|
IS_WARNING_FIELD_NUMBER: builtins.int
|
46
|
+
WIDTH_CONFIG_FIELD_NUMBER: builtins.int
|
45
47
|
type: builtins.str
|
46
48
|
"""The type of the exception. This can be any string, but is usually a valid
|
47
49
|
Python exception type, like 'RuntimeError'.
|
@@ -58,6 +60,10 @@ class Exception(google.protobuf.message.Message):
|
|
58
60
|
def stack_trace(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
59
61
|
"""The stack trace to print."""
|
60
62
|
|
63
|
+
@property
|
64
|
+
def width_config(self) -> streamlit.proto.WidthConfig_pb2.WidthConfig:
|
65
|
+
"""Indicates the width setting: "stetch", "content" or a pixel value."""
|
66
|
+
|
61
67
|
def __init__(
|
62
68
|
self,
|
63
69
|
*,
|
@@ -66,7 +72,9 @@ class Exception(google.protobuf.message.Message):
|
|
66
72
|
message_is_markdown: builtins.bool = ...,
|
67
73
|
stack_trace: collections.abc.Iterable[builtins.str] | None = ...,
|
68
74
|
is_warning: builtins.bool = ...,
|
75
|
+
width_config: streamlit.proto.WidthConfig_pb2.WidthConfig | None = ...,
|
69
76
|
) -> None: ...
|
70
|
-
def
|
77
|
+
def HasField(self, field_name: typing.Literal["width_config", b"width_config"]) -> builtins.bool: ...
|
78
|
+
def ClearField(self, field_name: typing.Literal["is_warning", b"is_warning", "message", b"message", "message_is_markdown", b"message_is_markdown", "stack_trace", b"stack_trace", "type", b"type", "width_config", b"width_config"]) -> None: ...
|
71
79
|
|
72
80
|
global___Exception = Exception
|
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import PageProfile_pb2 as streamlit_dot_proto_dot_PageProfile__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\xbf\x07\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x15\n\rmachine_id_v4\x18) \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x0e\n\x06\x61pp_id\x18! \x01(\t\x12\x12\n\nsession_id\x18# \x01(\t\x12\x16\n\x0epython_version\x18$ \x01(\t\x12\x11\n\tserver_os\x18* \x01(\t\x12\x13\n\x0bhas_display\x18+ \x01(\x08\x12\x14\n\x0cis_webdriver\x18, \x01(\x08\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\x10\n\x08numPages\x18\" \x01(\x03\x12\x18\n\x10page_script_hash\x18% \x01(\t\x12\x14\n\x0c\x61\x63tive_theme\x18& \x01(\t\x12\x17\n\x0ftotal_load_time\x18\' \x01(\x03\x12\"\n\x0c\x62rowser_info\x18( \x01(\x0b\x32\x0c.BrowserInfo\"]\n\x0b\x42rowserInfo\x12\x14\n\x0c\x62rowser_name\x18\x01 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x03 \x01(\t\x12\n\n\x02os\x18\x04 \x01(\tB1\n\x1c\x63om.snowflake.apps.streamlitB\x11MetricsEventProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -24,7 +24,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
24
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
25
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\021MetricsEventProto'
|
26
26
|
_globals['_METRICSEVENT']._serialized_start=74
|
27
|
-
_globals['_METRICSEVENT']._serialized_end=
|
28
|
-
_globals['_BROWSERINFO']._serialized_start=
|
29
|
-
_globals['_BROWSERINFO']._serialized_end=
|
27
|
+
_globals['_METRICSEVENT']._serialized_end=1033
|
28
|
+
_globals['_BROWSERINFO']._serialized_start=1035
|
29
|
+
_globals['_BROWSERINFO']._serialized_end=1128
|
30
30
|
# @@protoc_insertion_point(module_scope)
|
@@ -47,6 +47,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
47
47
|
PYTHON_VERSION_FIELD_NUMBER: builtins.int
|
48
48
|
SERVER_OS_FIELD_NUMBER: builtins.int
|
49
49
|
HAS_DISPLAY_FIELD_NUMBER: builtins.int
|
50
|
+
IS_WEBDRIVER_FIELD_NUMBER: builtins.int
|
50
51
|
HOSTED_AT_FIELD_NUMBER: builtins.int
|
51
52
|
OWNER_FIELD_NUMBER: builtins.int
|
52
53
|
REPO_FIELD_NUMBER: builtins.int
|
@@ -91,6 +92,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
91
92
|
python_version: builtins.str
|
92
93
|
server_os: builtins.str
|
93
94
|
has_display: builtins.bool
|
95
|
+
is_webdriver: builtins.bool
|
94
96
|
hosted_at: builtins.str
|
95
97
|
"""Host tracking fields:"""
|
96
98
|
owner: builtins.str
|
@@ -149,6 +151,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
149
151
|
python_version: builtins.str = ...,
|
150
152
|
server_os: builtins.str = ...,
|
151
153
|
has_display: builtins.bool = ...,
|
154
|
+
is_webdriver: builtins.bool = ...,
|
152
155
|
hosted_at: builtins.str = ...,
|
153
156
|
owner: builtins.str = ...,
|
154
157
|
repo: builtins.str = ...,
|
@@ -180,7 +183,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
180
183
|
browser_info: global___BrowserInfo | None = ...,
|
181
184
|
) -> None: ...
|
182
185
|
def HasField(self, field_name: typing.Literal["browser_info", b"browser_info"]) -> builtins.bool: ...
|
183
|
-
def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "has_display", b"has_display", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "server_os", b"server_os", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
|
186
|
+
def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "has_display", b"has_display", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "is_webdriver", b"is_webdriver", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "server_os", b"server_os", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
|
184
187
|
|
185
188
|
global___MetricsEvent = MetricsEvent
|
186
189
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: streamlit/proto/WidthConfig.proto
|
4
|
+
# Protobuf Python Version: 5.26.1
|
5
|
+
"""Generated protocol buffer code."""
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
9
|
+
from google.protobuf.internal import builder as _builder
|
10
|
+
# @@protoc_insertion_point(imports)
|
11
|
+
|
12
|
+
_sym_db = _symbol_database.Default()
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/WidthConfig.proto\x12\tstreamlit\"`\n\x0bWidthConfig\x12\x15\n\x0buse_stretch\x18\x01 \x01(\x08H\x00\x12\x15\n\x0buse_content\x18\x02 \x01(\x08H\x00\x12\x15\n\x0bpixel_width\x18\x03 \x01(\rH\x00\x42\x0c\n\nwidth_specB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bLayoutProtob\x06proto3')
|
18
|
+
|
19
|
+
_globals = globals()
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.WidthConfig_pb2', _globals)
|
22
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
23
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
24
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013LayoutProto'
|
25
|
+
_globals['_WIDTHCONFIG']._serialized_start=48
|
26
|
+
_globals['_WIDTHCONFIG']._serialized_end=144
|
27
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
Common layout-related enums and messages that can be reused across different elements."""
|
5
|
+
|
6
|
+
import builtins
|
7
|
+
import google.protobuf.descriptor
|
8
|
+
import google.protobuf.message
|
9
|
+
import typing
|
10
|
+
|
11
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
12
|
+
|
13
|
+
@typing.final
|
14
|
+
class WidthConfig(google.protobuf.message.Message):
|
15
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
16
|
+
|
17
|
+
USE_STRETCH_FIELD_NUMBER: builtins.int
|
18
|
+
USE_CONTENT_FIELD_NUMBER: builtins.int
|
19
|
+
PIXEL_WIDTH_FIELD_NUMBER: builtins.int
|
20
|
+
use_stretch: builtins.bool
|
21
|
+
use_content: builtins.bool
|
22
|
+
pixel_width: builtins.int
|
23
|
+
def __init__(
|
24
|
+
self,
|
25
|
+
*,
|
26
|
+
use_stretch: builtins.bool = ...,
|
27
|
+
use_content: builtins.bool = ...,
|
28
|
+
pixel_width: builtins.int = ...,
|
29
|
+
) -> None: ...
|
30
|
+
def HasField(self, field_name: typing.Literal["pixel_width", b"pixel_width", "use_content", b"use_content", "use_stretch", b"use_stretch", "width_spec", b"width_spec"]) -> builtins.bool: ...
|
31
|
+
def ClearField(self, field_name: typing.Literal["pixel_width", b"pixel_width", "use_content", b"use_content", "use_stretch", b"use_stretch", "width_spec", b"width_spec"]) -> None: ...
|
32
|
+
def WhichOneof(self, oneof_group: typing.Literal["width_spec", b"width_spec"]) -> typing.Literal["use_stretch", "use_content", "pixel_width"] | None: ...
|
33
|
+
|
34
|
+
global___WidthConfig = WidthConfig
|