streamlit-nightly 1.38.1.dev20240903__py2.py3-none-any.whl → 1.38.1.dev20240904__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.
@@ -14,7 +14,6 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- import time
18
17
  from typing import TYPE_CHECKING, Literal, cast
19
18
 
20
19
  from typing_extensions import Self, TypeAlias
@@ -87,8 +86,9 @@ class Dialog(DeltaGenerator):
87
86
  block_proto.dialog.dismissible = dismissible
88
87
  block_proto.dialog.width = _process_dialog_width_input(width)
89
88
 
90
- # We store the delta path here, because in _update we enqueue a new proto message to update the
91
- # open status. Without this, the dialog content is gone when the _update message is sent
89
+ # We store the delta path here, because in _update we enqueue a new proto
90
+ # message to update the open status. Without this, the dialog content is gone
91
+ # when the _update message is sent
92
92
  delta_path: list[int] = (
93
93
  parent._active_dg._cursor.delta_path if parent._active_dg._cursor else []
94
94
  )
@@ -96,9 +96,6 @@ class Dialog(DeltaGenerator):
96
96
 
97
97
  dialog._delta_path = delta_path
98
98
  dialog._current_proto = block_proto
99
- # We add a sleep here to give the web app time to react to the update. Otherwise,
100
- # we might run into issues where the dialog cannot be opened again after closing
101
- time.sleep(0.05)
102
99
  return dialog
103
100
 
104
101
  def __init__(
@@ -124,12 +121,8 @@ class Dialog(DeltaGenerator):
124
121
  msg.metadata.delta_path[:] = self._delta_path
125
122
  msg.delta.add_block.CopyFrom(self._current_proto)
126
123
  msg.delta.add_block.dialog.is_open = should_open
127
-
128
124
  self._current_proto = msg.delta.add_block
129
125
 
130
- # We add a sleep here to give the web app time to react to the update. Otherwise,
131
- # we might run into issues where the dialog cannot be opened again after closing
132
- time.sleep(0.05)
133
126
  enqueue_message(msg)
134
127
 
135
128
  def open(self) -> None:
@@ -206,6 +206,12 @@ class StreamlitPage:
206
206
  self._page: Path | Callable[[], None] = page
207
207
  self._title: str = title or inferred_name.replace("_", " ")
208
208
  self._icon: str = icon or inferred_icon
209
+
210
+ if self._title.strip() == "":
211
+ raise StreamlitAPIException(
212
+ "The title of the page cannot be empty or consist of underscores/spaces only"
213
+ )
214
+
209
215
  if url_path is not None and url_path.strip() == "" and not default:
210
216
  raise StreamlitAPIException(
211
217
  "The URL path cannot be an empty string unless the page is the default page."
@@ -560,7 +560,7 @@ class Runtime:
560
560
  uploaded_file_manager=self._uploaded_file_mgr,
561
561
  script_cache=self._script_cache,
562
562
  message_enqueued_callback=self._enqueued_some_message,
563
- user_info={"email": "test@test.com"},
563
+ user_info={"email": "test@example.com"},
564
564
  )
565
565
 
566
566
  try:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.5513bd04.css",
4
- "main.js": "./static/js/main.ba0d2afb.js",
4
+ "main.js": "./static/js/main.31d1a42d.js",
5
5
  "static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
6
6
  "static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
7
7
  "static/js/9077.e0a8db2a.chunk.js": "./static/js/9077.e0a8db2a.chunk.js",
@@ -153,6 +153,6 @@
153
153
  },
154
154
  "entrypoints": [
155
155
  "static/css/main.5513bd04.css",
156
- "static/js/main.ba0d2afb.js"
156
+ "static/js/main.31d1a42d.js"
157
157
  ]
158
158
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.ba0d2afb.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.31d1a42d.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>