streamlit-nightly 1.31.2.dev20240222__py2.py3-none-any.whl → 1.31.2.dev20240223__py2.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/testing/v1/app_test.py +30 -0
- streamlit/testing/v1/element_tree.py +58 -0
- {streamlit_nightly-1.31.2.dev20240222.dist-info → streamlit_nightly-1.31.2.dev20240223.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.31.2.dev20240222.dist-info → streamlit_nightly-1.31.2.dev20240223.dist-info}/RECORD +8 -8
- {streamlit_nightly-1.31.2.dev20240222.data → streamlit_nightly-1.31.2.dev20240223.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.31.2.dev20240222.dist-info → streamlit_nightly-1.31.2.dev20240223.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.31.2.dev20240222.dist-info → streamlit_nightly-1.31.2.dev20240223.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.31.2.dev20240222.dist-info → streamlit_nightly-1.31.2.dev20240223.dist-info}/top_level.txt +0 -0
streamlit/testing/v1/app_test.py
CHANGED
@@ -51,6 +51,7 @@ from streamlit.testing.v1.element_tree import (
|
|
51
51
|
ElementTree,
|
52
52
|
Error,
|
53
53
|
Exception,
|
54
|
+
Expander,
|
54
55
|
Header,
|
55
56
|
Info,
|
56
57
|
Json,
|
@@ -64,6 +65,7 @@ from streamlit.testing.v1.element_tree import (
|
|
64
65
|
Selectbox,
|
65
66
|
SelectSlider,
|
66
67
|
Slider,
|
68
|
+
Status,
|
67
69
|
Subheader,
|
68
70
|
Success,
|
69
71
|
Tab,
|
@@ -578,6 +580,20 @@ class AppTest:
|
|
578
580
|
"""
|
579
581
|
return self._tree.exception
|
580
582
|
|
583
|
+
@property
|
584
|
+
def expander(self) -> Sequence[Expander]:
|
585
|
+
"""Sequence of all ``st.expander`` elements.
|
586
|
+
|
587
|
+
Returns
|
588
|
+
-------
|
589
|
+
List of Expandable
|
590
|
+
Sequence of all ``st.expander`` elements. Individual elements can be
|
591
|
+
accessed from a list by index (order on the page). For
|
592
|
+
example, ``at.expander[0]`` for the first element. Expandable is an
|
593
|
+
extension of the Block class.
|
594
|
+
"""
|
595
|
+
return self._tree.expander
|
596
|
+
|
581
597
|
@property
|
582
598
|
def header(self) -> ElementList[Header]:
|
583
599
|
"""Sequence of all ``st.header`` elements.
|
@@ -774,6 +790,20 @@ class AppTest:
|
|
774
790
|
"""
|
775
791
|
return self._tree.success
|
776
792
|
|
793
|
+
@property
|
794
|
+
def status(self) -> Sequence[Status]:
|
795
|
+
"""Sequence of all ``st.status`` elements.
|
796
|
+
|
797
|
+
Returns
|
798
|
+
-------
|
799
|
+
List of Status
|
800
|
+
Sequence of all ``st.status`` elements. Individual elements can be
|
801
|
+
accessed from a list by index (order on the page). For
|
802
|
+
example, ``at.status[0]`` for the first element. Status is an
|
803
|
+
extension of the Block class.
|
804
|
+
"""
|
805
|
+
return self._tree.status
|
806
|
+
|
777
807
|
@property
|
778
808
|
def table(self) -> ElementList[Table]:
|
779
809
|
"""Sequence of all ``st.table`` elements.
|
@@ -1446,6 +1446,10 @@ class Block:
|
|
1446
1446
|
def exception(self) -> ElementList[Exception]:
|
1447
1447
|
return ElementList(self.get("exception")) # type: ignore
|
1448
1448
|
|
1449
|
+
@property
|
1450
|
+
def expander(self) -> Sequence[Expander]:
|
1451
|
+
return self.get("expander") # type: ignore
|
1452
|
+
|
1449
1453
|
@property
|
1450
1454
|
def header(self) -> ElementList[Header]:
|
1451
1455
|
return ElementList(self.get("header")) # type: ignore
|
@@ -1494,6 +1498,10 @@ class Block:
|
|
1494
1498
|
def slider(self) -> WidgetList[Slider[Any]]:
|
1495
1499
|
return WidgetList(self.get("slider")) # type: ignore
|
1496
1500
|
|
1501
|
+
@property
|
1502
|
+
def status(self) -> Sequence[Status]:
|
1503
|
+
return self.get("status") # type: ignore
|
1504
|
+
|
1497
1505
|
@property
|
1498
1506
|
def subheader(self) -> ElementList[Subheader]:
|
1499
1507
|
return ElementList(self.get("subheader")) # type: ignore
|
@@ -1672,6 +1680,51 @@ class Column(Block):
|
|
1672
1680
|
self.gap = proto.gap
|
1673
1681
|
|
1674
1682
|
|
1683
|
+
@dataclass(repr=False)
|
1684
|
+
class Expander(Block):
|
1685
|
+
type: str = field(repr=False)
|
1686
|
+
proto: BlockProto.Expandable = field(repr=False)
|
1687
|
+
icon: str
|
1688
|
+
label: str
|
1689
|
+
|
1690
|
+
def __init__(self, proto: BlockProto.Expandable, root: ElementTree):
|
1691
|
+
self.children = {}
|
1692
|
+
self.proto = proto
|
1693
|
+
self.root = root
|
1694
|
+
# The internal name is "expandable" but the public API uses "expander"
|
1695
|
+
# so the naming of the class and type follows the public name.
|
1696
|
+
self.type = "expander"
|
1697
|
+
self.icon = proto.icon
|
1698
|
+
self.label = proto.label
|
1699
|
+
|
1700
|
+
|
1701
|
+
@dataclass(repr=False)
|
1702
|
+
class Status(Block):
|
1703
|
+
type: str = field(repr=False)
|
1704
|
+
proto: BlockProto.Expandable = field(repr=False)
|
1705
|
+
icon: str
|
1706
|
+
label: str
|
1707
|
+
|
1708
|
+
def __init__(self, proto: BlockProto.Expandable, root: ElementTree):
|
1709
|
+
self.children = {}
|
1710
|
+
self.proto = proto
|
1711
|
+
self.root = root
|
1712
|
+
self.type = "status"
|
1713
|
+
self.icon = proto.icon
|
1714
|
+
self.label = proto.label
|
1715
|
+
|
1716
|
+
@property
|
1717
|
+
def state(self):
|
1718
|
+
if self.icon == "spinner":
|
1719
|
+
return "running"
|
1720
|
+
elif self.icon == "check":
|
1721
|
+
return "complete"
|
1722
|
+
elif self.icon == "error":
|
1723
|
+
return "error"
|
1724
|
+
else:
|
1725
|
+
raise ValueError("Unknown Status state")
|
1726
|
+
|
1727
|
+
|
1675
1728
|
@dataclass(repr=False)
|
1676
1729
|
class Tab(Block):
|
1677
1730
|
"""A representation of tab within ``st.tabs``."""
|
@@ -1897,6 +1950,11 @@ def parse_tree_from_messages(messages: list[ForwardMsg]) -> ElementTree:
|
|
1897
1950
|
new_node = ChatMessage(block.chat_message, root=root)
|
1898
1951
|
elif bty == "column":
|
1899
1952
|
new_node = Column(block.column, root=root)
|
1953
|
+
elif bty == "expandable":
|
1954
|
+
if block.expandable.icon:
|
1955
|
+
new_node = Status(block.expandable, root=root)
|
1956
|
+
else:
|
1957
|
+
new_node = Expander(block.expandable, root=root)
|
1900
1958
|
elif bty == "tab":
|
1901
1959
|
new_node = Tab(block.tab, root=root)
|
1902
1960
|
else:
|
@@ -474,8 +474,8 @@ streamlit/static/static/media/logo.83ae4f2fb87e38be7cbb8a5d2beb64d2.svg,sha256=_
|
|
474
474
|
streamlit/static/static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg,sha256=6ZIRbOQuBNsdJnpfrNMq-6mYpYDN8qJGVsxkZIn8bP8,39315
|
475
475
|
streamlit/testing/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
476
476
|
streamlit/testing/v1/__init__.py,sha256=XGxNOq4VfmwlVj9K6vXB8dAH1YbI_8AIsvw_vbzQoNA,690
|
477
|
-
streamlit/testing/v1/app_test.py,sha256
|
478
|
-
streamlit/testing/v1/element_tree.py,sha256=
|
477
|
+
streamlit/testing/v1/app_test.py,sha256=-XuZXviLYPDTEwBV4s8kmZl77s-XEegSzYTT1D2WRXA,35175
|
478
|
+
streamlit/testing/v1/element_tree.py,sha256=PqcK4w_6qSkahavyz_iCWtbXJxtU3SJbqqE029S6dus,59452
|
479
479
|
streamlit/testing/v1/local_script_runner.py,sha256=oa00hdDCB0pjVwBR4XGNNxAnOW4YuQCF29lwcHsvTDM,6329
|
480
480
|
streamlit/testing/v1/util.py,sha256=IwxXIlGsVNtC1RmtmgdeBHmJYPjK0wiqNL4HMW6IJZI,1791
|
481
481
|
streamlit/vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -504,9 +504,9 @@ streamlit/web/server/server_util.py,sha256=FptUF-CjFh78VjeTQDi3R78m7E64MDe3wcklg
|
|
504
504
|
streamlit/web/server/stats_request_handler.py,sha256=cL__KbJFIhdhf1Zt6skbLehUqT-jo56x1HARxogZDOI,3680
|
505
505
|
streamlit/web/server/upload_file_request_handler.py,sha256=YPDmKWUnaGH9d4QNcMEsY5k1YIz_q-xW1K5fmgHaDzc,4966
|
506
506
|
streamlit/web/server/websocket_headers.py,sha256=07SkWLcOxbyldl7UcBzrMKY9ZojypCQACiKoh5FcH7Y,1870
|
507
|
-
streamlit_nightly-1.31.2.
|
508
|
-
streamlit_nightly-1.31.2.
|
509
|
-
streamlit_nightly-1.31.2.
|
510
|
-
streamlit_nightly-1.31.2.
|
511
|
-
streamlit_nightly-1.31.2.
|
512
|
-
streamlit_nightly-1.31.2.
|
507
|
+
streamlit_nightly-1.31.2.dev20240223.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
|
508
|
+
streamlit_nightly-1.31.2.dev20240223.dist-info/METADATA,sha256=3_ZZRRTg04JT_Bk-c7hoiek5uY9wsTiakkfsYejg1Kk,8528
|
509
|
+
streamlit_nightly-1.31.2.dev20240223.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
510
|
+
streamlit_nightly-1.31.2.dev20240223.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
|
511
|
+
streamlit_nightly-1.31.2.dev20240223.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
|
512
|
+
streamlit_nightly-1.31.2.dev20240223.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|