streamlit-nightly 1.45.2.dev20250523__py3-none-any.whl → 1.45.2.dev20250526__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.
Files changed (98) hide show
  1. streamlit/commands/echo.py +1 -1
  2. streamlit/config.py +2 -1
  3. streamlit/config_option.py +1 -1
  4. streamlit/config_util.py +4 -5
  5. streamlit/elements/exception.py +4 -12
  6. streamlit/elements/graphviz_chart.py +1 -1
  7. streamlit/elements/heading.py +3 -4
  8. streamlit/elements/lib/image_utils.py +2 -3
  9. streamlit/elements/markdown.py +1 -1
  10. streamlit/elements/media.py +1 -1
  11. streamlit/elements/progress.py +3 -3
  12. streamlit/elements/widgets/button.py +1 -1
  13. streamlit/elements/widgets/color_picker.py +8 -14
  14. streamlit/elements/widgets/radio.py +1 -1
  15. streamlit/elements/widgets/selectbox.py +1 -1
  16. streamlit/elements/widgets/slider.py +10 -18
  17. streamlit/elements/widgets/text_widgets.py +1 -2
  18. streamlit/hello/animation_demo.py +1 -1
  19. streamlit/hello/mapping_demo.py +3 -4
  20. streamlit/logger.py +1 -1
  21. streamlit/runtime/caching/hashing.py +8 -9
  22. streamlit/runtime/credentials.py +8 -21
  23. streamlit/static/index.html +1 -1
  24. streamlit/static/static/js/{ErrorOutline.esm.qteVcUUN.js → ErrorOutline.esm.CtshIbC5.js} +1 -1
  25. streamlit/static/static/js/{FileDownload.esm.ncu7N-Hr.js → FileDownload.esm.A0XrMp_A.js} +1 -1
  26. streamlit/static/static/js/{FileHelper.zsMZ7RXt.js → FileHelper.BkYmOfR4.js} +1 -1
  27. streamlit/static/static/js/{FormClearHelper.W8yVYXZp.js → FormClearHelper.DvUrjO5s.js} +1 -1
  28. streamlit/static/static/js/{Hooks.DBj6srQ1.js → Hooks.Dw0PPeMp.js} +1 -1
  29. streamlit/static/static/js/{InputInstructions.BobLsJJb.js → InputInstructions.BwkpOG-3.js} +1 -1
  30. streamlit/static/static/js/{ProgressBar.CtvJrIzN.js → ProgressBar.Po8toa5U.js} +1 -1
  31. streamlit/static/static/js/{RenderInPortalIfExists.DnT_UdzV.js → RenderInPortalIfExists.DG7izwhP.js} +1 -1
  32. streamlit/static/static/js/{Toolbar.BVF7NtOB.js → Toolbar.zoRxypF9.js} +1 -1
  33. streamlit/static/static/js/{base-input.B4sdS3vw.js → base-input.3hmq5vR4.js} +1 -1
  34. streamlit/static/static/js/{checkbox.DKDitzF8.js → checkbox.DHVebTBP.js} +1 -1
  35. streamlit/static/static/js/{createSuper.mhx956J9.js → createSuper.CCzF882j.js} +1 -1
  36. streamlit/static/static/js/{data-grid-overlay-editor.CmXS0PAX.js → data-grid-overlay-editor.CRIS0V5u.js} +1 -1
  37. streamlit/static/static/js/{downloader.Cnd9SuxG.js → downloader.DOuJ7F43.js} +1 -1
  38. streamlit/static/static/js/{es6.DM-pf09u.js → es6.BojNhy97.js} +2 -2
  39. streamlit/static/static/js/{iframeResizer.contentWindow.Gc5GAjZM.js → iframeResizer.contentWindow.CmN7IDO7.js} +1 -1
  40. streamlit/static/static/js/{index.WWYmGCrM.js → index.3HscCA0Q.js} +1 -1
  41. streamlit/static/static/js/{index.BV38yp5k.js → index.B0GUCtHl.js} +1 -1
  42. streamlit/static/static/js/{index.DdyZtGcg.js → index.B3Y99Usz.js} +1 -1
  43. streamlit/static/static/js/{index.DIyx-z1Q.js → index.B6guKn0h.js} +1 -1
  44. streamlit/static/static/js/{index.CjBaoWYr.js → index.BEfxU01i.js} +1 -1
  45. streamlit/static/static/js/{index.BfusYuD8.js → index.BMWx_YQD.js} +1 -1
  46. streamlit/static/static/js/{index.BWTBe3a1.js → index.BV-8GugV.js} +1 -1
  47. streamlit/static/static/js/{index.gBOr8z2K.js → index.BXfm7UZe.js} +1 -1
  48. streamlit/static/static/js/{index.CWgnk1N4.js → index.BfcdLS9y.js} +1 -1
  49. streamlit/static/static/js/{index.COBionvf.js → index.BgmEuudT.js} +1 -1
  50. streamlit/static/static/js/{index.DQGSbu2C.js → index.BsiojTxz.js} +1 -1
  51. streamlit/static/static/js/{index.I3iNnzJx.js → index.BvWDoWjf.js} +1 -1
  52. streamlit/static/static/js/{index.p2Wl4zMi.js → index.CLFnBokZ.js} +1 -1
  53. streamlit/static/static/js/{index.DOl-SOKu.js → index.CPiByGGr.js} +1 -1
  54. streamlit/static/static/js/{index.C_2m4F7k.js → index.CTVSiPCo.js} +1 -1
  55. streamlit/static/static/js/{index.DTU7qmDP.js → index.CVxkW_lc.js} +1 -1
  56. streamlit/static/static/js/{index.BkLkRTpZ.js → index.CWweAMBx.js} +1 -1
  57. streamlit/static/static/js/{index.BR-S54Iv.js → index.CZ6f-p0K.js} +1 -1
  58. streamlit/static/static/js/{index.B45ExNhw.js → index.CdgLDqMc.js} +1 -1
  59. streamlit/static/static/js/{index.DAvhwYMG.js → index.Cpz3pp0B.js} +1 -1
  60. streamlit/static/static/js/{index.CJ-XXd1r.js → index.CzMgwzgb.js} +1 -1
  61. streamlit/static/static/js/{index.DOYomqqU.js → index.DH2YAEv6.js} +1 -1
  62. streamlit/static/static/js/{index.B0E6Rv1F.js → index.DNlMgaSP.js} +1 -1
  63. streamlit/static/static/js/{index.CgOynO1t.js → index.DP7RHJHC.js} +1 -1
  64. streamlit/static/static/js/{index.B29JQLHa.js → index.DcLQo3NB.js} +5 -5
  65. streamlit/static/static/js/{index.BJQNG4O1.js → index.DkNaEiLi.js} +1 -1
  66. streamlit/static/static/js/{index.BONHiJUZ.js → index.DtpZrdsz.js} +1 -1
  67. streamlit/static/static/js/{index.AWkO-7e-.js → index.HdiDLe37.js} +1 -1
  68. streamlit/static/static/js/{index.B6xTo8b8.js → index.Ih0EXMso.js} +1 -1
  69. streamlit/static/static/js/{index.vOqxh1m2.js → index.R5J-UXhx.js} +1 -1
  70. streamlit/static/static/js/{index.D4XRYl23.js → index.VVmp3qV7.js} +1 -1
  71. streamlit/static/static/js/{index.DwUISpCs.js → index.YePOPnW6.js} +5 -5
  72. streamlit/static/static/js/{index.BNNR5Jmd.js → index.YtwVjbe-.js} +1 -1
  73. streamlit/static/static/js/{index._BaeK1t7.js → index.kWUcv9pK.js} +1 -1
  74. streamlit/static/static/js/{index.CkKptP1T.js → index.muQ-sA7D.js} +1 -1
  75. streamlit/static/static/js/{index.C5KKmyWy.js → index.p5qVS5RU.js} +1 -1
  76. streamlit/static/static/js/{index.CZ5fZcT5.js → index.whcmqOYZ.js} +1 -1
  77. streamlit/static/static/js/{input.BvD9DHLa.js → input.C95vVzrH.js} +1 -1
  78. streamlit/static/static/js/{memory.DCVB1HOm.js → memory.lfILky3m.js} +1 -1
  79. streamlit/static/static/js/{mergeWith.BqTORFAq.js → mergeWith.CdpKbzWl.js} +1 -1
  80. streamlit/static/static/js/{number-overlay-editor.VB_OvuPv.js → number-overlay-editor.D2TjUrKf.js} +1 -1
  81. streamlit/static/static/js/{possibleConstructorReturn.DhYxBDlj.js → possibleConstructorReturn.DQV58bYB.js} +1 -1
  82. streamlit/static/static/js/{sandbox.CoN7LRFk.js → sandbox.R1dhBCnm.js} +1 -1
  83. streamlit/static/static/js/{textarea.DkHpIjdT.js → textarea.t5D4QCw3.js} +1 -1
  84. streamlit/static/static/js/{timepicker.C8UIzYhf.js → timepicker.BI9iPIxz.js} +1 -1
  85. streamlit/static/static/js/{toConsumableArray.DXfr1fvT.js → toConsumableArray.COyXrPhy.js} +1 -1
  86. streamlit/static/static/js/{uniqueId.CgrMSBTb.js → uniqueId.CaWObuU_.js} +1 -1
  87. streamlit/static/static/js/{useBasicWidgetState.C-e-WEFS.js → useBasicWidgetState.Wd2TSACf.js} +1 -1
  88. streamlit/static/static/js/{useOnInputChange.CtRJhZD6.js → useOnInputChange.CUFXty-S.js} +1 -1
  89. streamlit/static/static/js/{withFullScreenWrapper.od0SAvAK.js → withFullScreenWrapper.wgkD5MeK.js} +1 -1
  90. streamlit/watcher/path_watcher.py +2 -3
  91. streamlit/web/bootstrap.py +1 -1
  92. streamlit/web/server/server.py +1 -1
  93. {streamlit_nightly-1.45.2.dev20250523.dist-info → streamlit_nightly-1.45.2.dev20250526.dist-info}/METADATA +2 -2
  94. {streamlit_nightly-1.45.2.dev20250523.dist-info → streamlit_nightly-1.45.2.dev20250526.dist-info}/RECORD +98 -98
  95. {streamlit_nightly-1.45.2.dev20250523.dist-info → streamlit_nightly-1.45.2.dev20250526.dist-info}/WHEEL +1 -1
  96. {streamlit_nightly-1.45.2.dev20250523.data → streamlit_nightly-1.45.2.dev20250526.data}/scripts/streamlit.cmd +0 -0
  97. {streamlit_nightly-1.45.2.dev20250523.dist-info → streamlit_nightly-1.45.2.dev20250526.dist-info}/entry_points.txt +0 -0
  98. {streamlit_nightly-1.45.2.dev20250523.dist-info → streamlit_nightly-1.45.2.dev20250526.dist-info}/top_level.txt +0 -0
@@ -101,7 +101,7 @@ def echo(
101
101
  show_code(code_string, "python")
102
102
 
103
103
  except FileNotFoundError as err:
104
- show_warning("Unable to display code. %s" % err)
104
+ show_warning(f"Unable to display code. {err}")
105
105
 
106
106
 
107
107
  def _get_initial_indent(lines: Iterable[str]) -> int:
streamlit/config.py CHANGED
@@ -1301,7 +1301,8 @@ def get_where_defined(key: str) -> str:
1301
1301
  config_options = get_config_options()
1302
1302
 
1303
1303
  if key not in config_options:
1304
- raise RuntimeError('Config key "%s" not defined.' % key)
1304
+ msg = f'Config key "{key}" not defined.'
1305
+ raise RuntimeError(msg)
1305
1306
  return config_options[key].where_defined
1306
1307
 
1307
1308
 
@@ -189,7 +189,7 @@ class ConfigOption:
189
189
  if self.replaced_by:
190
190
  self.deprecated = True
191
191
  if deprecation_text is None:
192
- deprecation_text = "Replaced by %s." % self.replaced_by
192
+ deprecation_text = f"Replaced by {self.replaced_by}."
193
193
 
194
194
  if self.deprecated:
195
195
  if not expiration_date:
streamlit/config_util.py CHANGED
@@ -84,7 +84,7 @@ def show_config(
84
84
  continue
85
85
 
86
86
  out.append("")
87
- append_section("[%s]" % section)
87
+ append_section(f"[{section}]")
88
88
  out.append("")
89
89
 
90
90
  for option in section_options.values():
@@ -125,8 +125,7 @@ def show_config(
125
125
  append_comment(line)
126
126
  append_comment("")
127
127
  append_comment(
128
- "This option will be removed on or after %s."
129
- % option.expiration_date
128
+ f"This option will be removed on or after {option.expiration_date}."
130
129
  )
131
130
 
132
131
  import toml
@@ -138,7 +137,7 @@ def show_config(
138
137
  # Ensure a line break before appending "Default" comment, if not already there
139
138
  if out[-1] != "#":
140
139
  append_comment("")
141
- append_comment("Default: %s" % toml_default)
140
+ append_comment(f"Default: {toml_default}")
142
141
  else:
143
142
  # Don't say "Default: (unset)" here because this branch applies
144
143
  # to complex config settings too.
@@ -151,7 +150,7 @@ def show_config(
151
150
  if option_is_manually_set:
152
151
  if out[-1] != "# ":
153
152
  append_comment("")
154
- append_comment("The value below was set in %s" % option.where_defined)
153
+ append_comment(f"The value below was set in {option.where_defined}")
155
154
 
156
155
  toml_setting = toml.dumps({key: option.value})
157
156
 
@@ -237,18 +237,10 @@ def _format_syntax_error_message(exception: SyntaxError) -> str:
237
237
  )
238
238
 
239
239
  return (
240
- 'File "%(filename)s", line %(lineno)s\n'
241
- " %(text)s\n"
242
- " %(caret_indent)s^\n"
243
- "%(errname)s: %(msg)s"
244
- % {
245
- "filename": exception.filename,
246
- "lineno": exception.lineno,
247
- "text": exception.text.rstrip(),
248
- "caret_indent": caret_indent,
249
- "errname": type(exception).__name__,
250
- "msg": exception.msg,
251
- }
240
+ f'File "{exception.filename}", line {exception.lineno}\n'
241
+ f" {exception.text.rstrip()}\n"
242
+ f" {caret_indent}^\n"
243
+ f"{type(exception).__name__}: {exception.msg}"
252
244
  )
253
245
  # If a few edge cases, SyntaxErrors don't have all these nice fields. So we
254
246
  # have a fall back here.
@@ -141,7 +141,7 @@ def marshall(
141
141
  engine = "dot"
142
142
  else:
143
143
  raise StreamlitAPIException(
144
- "Unhandled type for graphviz chart: %s" % type(figure_or_dot)
144
+ f"Unhandled type for graphviz chart: {type(figure_or_dot)}"
145
145
  )
146
146
 
147
147
  proto.spec = dot
@@ -286,14 +286,13 @@ class HeadingMixin:
286
286
  proto.anchor = anchor
287
287
  elif anchor is True: # type: ignore
288
288
  raise StreamlitAPIException(
289
- "Anchor parameter has invalid value: %s. "
290
- "Supported values: None, any string or False" % anchor
289
+ f"Anchor parameter has invalid value: {anchor}. "
290
+ "Supported values: None, any string or False"
291
291
  )
292
292
  else:
293
293
  raise StreamlitAPIException(
294
- "Anchor parameter has invalid type: %s. "
294
+ f"Anchor parameter has invalid type: {type(anchor).__name__}. "
295
295
  "Supported values: None, any string or False"
296
- % type(anchor).__name__
297
296
  )
298
297
 
299
298
  if help:
@@ -160,8 +160,7 @@ def _verify_np_shape(array: npt.NDArray[Any]) -> npt.NDArray[Any]:
160
160
  raise StreamlitAPIException("Numpy shape has to be of length 2 or 3.")
161
161
  if len(shape) == 3 and shape[-1] not in (1, 3, 4):
162
162
  raise StreamlitAPIException(
163
- "Channel can only be 1, 3, or 4 got %d. Shape is %s"
164
- % (shape[-1], str(shape))
163
+ f"Channel can only be 1, 3, or 4 got {shape[-1]}. Shape is {shape}"
165
164
  )
166
165
 
167
166
  # If there's only one channel, convert is to x, y
@@ -437,7 +436,7 @@ def marshall_images(
437
436
 
438
437
  # We use the index of the image in the input image list to identify this image inside
439
438
  # MediaFileManager. For this, we just add the index to the image's "coordinates".
440
- image_id = "%s-%i" % (coordinates, coord_suffix)
439
+ image_id = f"{coordinates}-{coord_suffix}"
441
440
 
442
441
  proto_img.url = image_to_url(
443
442
  single_image, width, clamp, channels, output_format, image_id
@@ -252,7 +252,7 @@ class MarkdownMixin:
252
252
  body = sympy.latex(body)
253
253
 
254
254
  latex_proto = MarkdownProto()
255
- latex_proto.body = "$$\n%s\n$$" % clean_text(body)
255
+ latex_proto.body = f"$$\n{clean_text(body)}\n$$"
256
256
  latex_proto.element_type = MarkdownProto.Type.LATEX
257
257
  if help:
258
258
  latex_proto.help = help
@@ -478,7 +478,7 @@ def _marshall_av_media(
478
478
  elif type_util.is_type(data, "numpy.ndarray"):
479
479
  data_or_filename = cast("npt.NDArray[Any]", data).tobytes()
480
480
  else:
481
- raise RuntimeError("Invalid binary data format: %s" % type(data))
481
+ raise RuntimeError(f"Invalid binary data format: {type(data)}")
482
482
 
483
483
  if runtime.exists():
484
484
  file_url = runtime.get_instance().media_file_mgr.add(
@@ -66,17 +66,17 @@ def _get_value(value: FloatOrInt) -> int:
66
66
  if 0 <= value <= 100:
67
67
  return value
68
68
  raise StreamlitAPIException(
69
- "Progress Value has invalid value [0, 100]: %d" % value
69
+ f"Progress Value has invalid value [0, 100]: {value}"
70
70
  )
71
71
 
72
72
  if isinstance(value, float):
73
73
  if _check_float_between(value, low=0.0, high=1.0):
74
74
  return int(value * 100)
75
75
  raise StreamlitAPIException(
76
- "Progress Value has invalid value [0.0, 1.0]: %f" % value
76
+ f"Progress Value has invalid value [0.0, 1.0]: {value}"
77
77
  )
78
78
  raise StreamlitAPIException(
79
- "Progress Value has invalid type: %s" % type(value).__name__
79
+ f"Progress Value has invalid type: {type(value).__name__}"
80
80
  )
81
81
 
82
82
 
@@ -1105,7 +1105,7 @@ def marshall_file(
1105
1105
  data_as_bytes = data.read() or b""
1106
1106
  mimetype = mimetype or "application/octet-stream"
1107
1107
  else:
1108
- raise StreamlitAPIException("Invalid binary data format: %s" % type(data))
1108
+ raise StreamlitAPIException(f"Invalid binary data format: {type(data)}")
1109
1109
 
1110
1110
  if runtime.exists():
1111
1111
  file_url = runtime.get_instance().media_file_mgr.add(
@@ -206,25 +206,19 @@ class ColorPickerMixin:
206
206
 
207
207
  # make sure the value is a string
208
208
  if not isinstance(value, str):
209
- raise StreamlitAPIException(
210
- """
211
- Color Picker Value has invalid type: %s. Expects a hex string
212
- like '#00FFAA' or '#000'.
213
- """
214
- % type(value).__name__
215
- )
209
+ raise StreamlitAPIException(f"""
210
+ Color Picker Value has invalid type: {type(value).__name__}. Expects a hex string
211
+ like '#00FFAA' or '#000'.
212
+ """)
216
213
 
217
214
  # validate the value and expects a hex string
218
215
  match = re.match(r"^#(?:[0-9a-fA-F]{3}){1,2}$", value)
219
216
 
220
217
  if not match:
221
- raise StreamlitAPIException(
222
- """
223
- '%s' is not a valid hex code for colors. Valid ones are like
224
- '#00FFAA' or '#000'.
225
- """
226
- % value
227
- )
218
+ raise StreamlitAPIException(f"""
219
+ '{value}' is not a valid hex code for colors. Valid ones are like
220
+ '#00FFAA' or '#000'.
221
+ """)
228
222
 
229
223
  color_picker_proto = ColorPickerProto()
230
224
  color_picker_proto.id = element_id
@@ -351,7 +351,7 @@ class RadioMixin:
351
351
 
352
352
  if not isinstance(index, int) and index is not None:
353
353
  raise StreamlitAPIException(
354
- "Radio Value has invalid type: %s" % type(index).__name__
354
+ f"Radio Value has invalid type: {type(index).__name__}"
355
355
  )
356
356
 
357
357
  if index is not None and len(opt) > 0 and not 0 <= index < len(opt):
@@ -495,7 +495,7 @@ class SelectboxMixin:
495
495
 
496
496
  if not isinstance(index, int) and index is not None:
497
497
  raise StreamlitAPIException(
498
- "Selectbox Value has invalid type: %s" % type(index).__name__
498
+ f"Selectbox Value has invalid type: {type(index).__name__}"
499
499
  )
500
500
 
501
501
  if index is not None and len(opt) > 0 and not 0 <= index < len(opt):
@@ -813,17 +813,13 @@ class SliderMixin:
813
813
  )
814
814
 
815
815
  if not int_args and not float_args and not timelike_args:
816
- raise StreamlitAPIException(
816
+ msg = (
817
817
  "Slider value arguments must be of matching types."
818
- "\n`min_value` has %(min_type)s type."
819
- "\n`max_value` has %(max_type)s type."
820
- "\n`step` has %(step)s type."
821
- % {
822
- "min_type": type(min_value).__name__,
823
- "max_type": type(max_value).__name__,
824
- "step": type(step).__name__,
825
- }
818
+ f"\n`min_value` has {type(min_value).__name__} type."
819
+ f"\n`max_value` has {type(max_value).__name__} type."
820
+ f"\n`step` has {type(step).__name__} type."
826
821
  )
822
+ raise StreamlitAPIException(msg)
827
823
 
828
824
  # Ensure that the value matches arguments' types.
829
825
  all_ints = data_type == SliderProto.INT and int_args
@@ -831,17 +827,13 @@ class SliderMixin:
831
827
  all_timelikes = data_type in TIMELIKE_TYPES and timelike_args
832
828
 
833
829
  if not all_ints and not all_floats and not all_timelikes:
834
- raise StreamlitAPIException(
830
+ msg = (
835
831
  "Both value and arguments must be of the same type."
836
- "\n`value` has %(value_type)s type."
837
- "\n`min_value` has %(min_type)s type."
838
- "\n`max_value` has %(max_type)s type."
839
- % {
840
- "value_type": type(value).__name__,
841
- "min_type": type(min_value).__name__,
842
- "max_type": type(max_value).__name__,
843
- }
832
+ f"\n`value` has {type(value).__name__} type."
833
+ f"\n`min_value` has {type(min_value).__name__} type."
834
+ f"\n`max_value` has {type(max_value).__name__} type."
844
835
  )
836
+ raise StreamlitAPIException(msg)
845
837
 
846
838
  # Ensure that min <= value(s) <= max, adjusting the bounds as necessary.
847
839
  min_value = min(min_value, max_value)
@@ -369,8 +369,7 @@ class TextWidgetsMixin:
369
369
  text_input_proto.type = TextInputProto.PASSWORD
370
370
  else:
371
371
  raise StreamlitAPIException(
372
- "'%s' is not a valid text_input type. Valid types are 'default' and 'password'."
373
- % type
372
+ f"'{type}' is not a valid text_input type. Valid types are 'default' and 'password'."
374
373
  )
375
374
 
376
375
  # Marshall the autocomplete param. If unspecified, this will be
@@ -42,7 +42,7 @@ def animation_demo() -> None:
42
42
  for frame_num, a in enumerate(np.linspace(0.0, 4 * np.pi, 100)):
43
43
  # Here were setting value for these two elements.
44
44
  progress_bar.progress(frame_num)
45
- frame_text.text("Frame %i/100" % (frame_num + 1))
45
+ frame_text.text(f"Frame {frame_num + 1}/100")
46
46
 
47
47
  # Performing some fractal wizardry.
48
48
  c = separation * np.exp(1j * a)
@@ -26,7 +26,7 @@ def mapping_demo() -> None:
26
26
  def from_data_file(filename: str) -> pd.DataFrame:
27
27
  url = (
28
28
  "https://raw.githubusercontent.com/streamlit/"
29
- "example-data/master/hello/v1/%s" % filename
29
+ f"example-data/master/hello/v1/{filename}"
30
30
  )
31
31
  return pd.read_json(url)
32
32
 
@@ -95,11 +95,10 @@ def mapping_demo() -> None:
95
95
  st.error("Please choose at least one layer above.")
96
96
  except URLError as e:
97
97
  st.error(
98
- """
98
+ f"""
99
99
  **This demo requires internet access.**
100
- Connection error: %s
100
+ Connection error: {e.reason}
101
101
  """
102
- % e.reason
103
102
  )
104
103
 
105
104
 
streamlit/logger.py CHANGED
@@ -46,7 +46,7 @@ def set_log_level(level: str | int) -> None:
46
46
  elif level in {"DEBUG", logging.DEBUG}:
47
47
  log_level = logging.DEBUG
48
48
  else:
49
- msg = 'undefined log level "%s"' % level
49
+ msg = f'undefined log level "{level}"'
50
50
  logger.critical(msg)
51
51
  sys.exit(1)
52
52
 
@@ -92,26 +92,25 @@ class UserHashError(StreamlitAPIException):
92
92
  args = self._get_error_message_args(orig_exc, cached_func)
93
93
 
94
94
  return (
95
- """
96
- %(orig_exception_desc)s
95
+ f"""
96
+ {args["orig_exception_desc"]}
97
97
 
98
- This error is likely due to a bug in %(hash_func_name)s, which is a
99
- user-defined hash function that was passed into the `%(cache_primitive)s` decorator of
100
- %(object_desc)s.
98
+ This error is likely due to a bug in {args["hash_func_name"]}, which is a
99
+ user-defined hash function that was passed into the `{args["cache_primitive"]}` decorator of
100
+ {args["object_desc"]}.
101
101
 
102
- %(hash_func_name)s failed when hashing an object of type
103
- `%(failed_obj_type_str)s`. If you don't know where that object is coming from,
102
+ {args["hash_func_name"]} failed when hashing an object of type
103
+ `{args["failed_obj_type_str"]}`. If you don't know where that object is coming from,
104
104
  try looking at the hash chain below for an object that you do recognize, then
105
105
  pass that to `hash_funcs` instead:
106
106
 
107
107
  ```
108
- %(hash_stack)s
108
+ {args["hash_stack"]}
109
109
  ```
110
110
 
111
111
  If you think this is actually a Streamlit bug, please
112
112
  [file a bug report here](https://github.com/streamlit/streamlit/issues/new/choose).
113
113
  """
114
- % args
115
114
  ).strip("\n")
116
115
 
117
116
  def _get_error_message_args(
@@ -263,41 +263,28 @@ class Credentials:
263
263
  if self.activation.is_valid:
264
264
  self.save()
265
265
  # IMPORTANT: Break the text below at 80 chars.
266
- TELEMETRY_TEXT = """
267
- You can find our privacy policy at %(link)s
266
+ TELEMETRY_TEXT = f"""
267
+ You can find our privacy policy at {cli_util.style_for_cli("https://streamlit.io/privacy-policy", underline=True)}
268
268
 
269
269
  Summary:
270
270
  - This open source library collects usage statistics.
271
271
  - We cannot see and do not store information contained inside Streamlit apps,
272
272
  such as text, charts, images, etc.
273
273
  - Telemetry data is stored in servers in the United States.
274
- - If you'd like to opt out, add the following to %(config)s,
274
+ - If you'd like to opt out, add the following to {cli_util.style_for_cli(_CONFIG_FILE_PATH)},
275
275
  creating that file if necessary:
276
276
 
277
277
  [browser]
278
278
  gatherUsageStats = false
279
- """ % {
280
- "link": cli_util.style_for_cli(
281
- "https://streamlit.io/privacy-policy", underline=True
282
- ),
283
- "config": cli_util.style_for_cli(_CONFIG_FILE_PATH),
284
- }
279
+ """
285
280
 
286
281
  cli_util.print_to_cli(TELEMETRY_TEXT)
287
282
  if show_instructions:
288
283
  # IMPORTANT: Break the text below at 80 chars.
289
- INSTRUCTIONS_TEXT = """
290
- %(start)s
291
- %(prompt)s %(hello)s
292
- """ % {
293
- "start": cli_util.style_for_cli(
294
- "Get started by typing:", fg="blue", bold=True
295
- ),
296
- "prompt": cli_util.style_for_cli("$", fg="blue"),
297
- "hello": cli_util.style_for_cli(
298
- "streamlit hello", bold=True
299
- ),
300
- }
284
+ INSTRUCTIONS_TEXT = f"""
285
+ {cli_util.style_for_cli("Get started by typing:", fg="blue", bold=True)}
286
+ {cli_util.style_for_cli("$", fg="blue")} {cli_util.style_for_cli("streamlit hello", bold=True)}
287
+ """
301
288
 
302
289
  cli_util.print_to_cli(INSTRUCTIONS_TEXT)
303
290
  activated = True
@@ -51,7 +51,7 @@
51
51
  <script>
52
52
  window.prerenderReady = false
53
53
  </script>
54
- <script type="module" crossorigin src="./static/js/index.DwUISpCs.js"></script>
54
+ <script type="module" crossorigin src="./static/js/index.YePOPnW6.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="./static/css/index.C6rq3aMZ.css">
56
56
  </head>
57
57
  <body>
@@ -1 +1 @@
1
- import{r,E as a,_ as n}from"./index.DwUISpCs.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
1
+ import{r,E as a,_ as n}from"./index.YePOPnW6.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
@@ -1 +1 @@
1
- import{r as e,E as n,_ as a}from"./index.DwUISpCs.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
1
+ import{r as e,E as n,_ as a}from"./index.YePOPnW6.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};