streamlit-nightly 1.45.2.dev20250526__py3-none-any.whl → 1.45.2.dev20250527__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 +1 -2
  3. streamlit/config_option.py +1 -1
  4. streamlit/config_util.py +5 -4
  5. streamlit/elements/exception.py +12 -4
  6. streamlit/elements/graphviz_chart.py +1 -1
  7. streamlit/elements/heading.py +4 -3
  8. streamlit/elements/lib/image_utils.py +3 -2
  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 +14 -8
  14. streamlit/elements/widgets/radio.py +1 -1
  15. streamlit/elements/widgets/selectbox.py +1 -1
  16. streamlit/elements/widgets/slider.py +18 -10
  17. streamlit/elements/widgets/text_widgets.py +2 -1
  18. streamlit/hello/animation_demo.py +1 -1
  19. streamlit/hello/mapping_demo.py +4 -3
  20. streamlit/logger.py +1 -1
  21. streamlit/runtime/caching/hashing.py +9 -8
  22. streamlit/runtime/credentials.py +21 -8
  23. streamlit/static/index.html +1 -1
  24. streamlit/static/static/js/{ErrorOutline.esm.CtshIbC5.js → ErrorOutline.esm.qteVcUUN.js} +1 -1
  25. streamlit/static/static/js/{FileDownload.esm.A0XrMp_A.js → FileDownload.esm.ncu7N-Hr.js} +1 -1
  26. streamlit/static/static/js/{FileHelper.BkYmOfR4.js → FileHelper.zsMZ7RXt.js} +1 -1
  27. streamlit/static/static/js/{FormClearHelper.DvUrjO5s.js → FormClearHelper.W8yVYXZp.js} +1 -1
  28. streamlit/static/static/js/{Hooks.Dw0PPeMp.js → Hooks.DBj6srQ1.js} +1 -1
  29. streamlit/static/static/js/{InputInstructions.BwkpOG-3.js → InputInstructions.BobLsJJb.js} +1 -1
  30. streamlit/static/static/js/{ProgressBar.Po8toa5U.js → ProgressBar.CtvJrIzN.js} +1 -1
  31. streamlit/static/static/js/{RenderInPortalIfExists.DG7izwhP.js → RenderInPortalIfExists.DnT_UdzV.js} +1 -1
  32. streamlit/static/static/js/{Toolbar.zoRxypF9.js → Toolbar.BVF7NtOB.js} +1 -1
  33. streamlit/static/static/js/{base-input.3hmq5vR4.js → base-input.B4sdS3vw.js} +1 -1
  34. streamlit/static/static/js/{checkbox.DHVebTBP.js → checkbox.DKDitzF8.js} +1 -1
  35. streamlit/static/static/js/{createSuper.CCzF882j.js → createSuper.mhx956J9.js} +1 -1
  36. streamlit/static/static/js/{data-grid-overlay-editor.CRIS0V5u.js → data-grid-overlay-editor.CmXS0PAX.js} +1 -1
  37. streamlit/static/static/js/{downloader.DOuJ7F43.js → downloader.Cnd9SuxG.js} +1 -1
  38. streamlit/static/static/js/{es6.BojNhy97.js → es6.DM-pf09u.js} +2 -2
  39. streamlit/static/static/js/{iframeResizer.contentWindow.CmN7IDO7.js → iframeResizer.contentWindow.Gc5GAjZM.js} +1 -1
  40. streamlit/static/static/js/{index.HdiDLe37.js → index.AWkO-7e-.js} +1 -1
  41. streamlit/static/static/js/{index.DNlMgaSP.js → index.B0E6Rv1F.js} +1 -1
  42. streamlit/static/static/js/{index.DcLQo3NB.js → index.B29JQLHa.js} +5 -5
  43. streamlit/static/static/js/{index.CdgLDqMc.js → index.B45ExNhw.js} +1 -1
  44. streamlit/static/static/js/{index.Ih0EXMso.js → index.B6xTo8b8.js} +1 -1
  45. streamlit/static/static/js/{index.DkNaEiLi.js → index.BJQNG4O1.js} +1 -1
  46. streamlit/static/static/js/{index.YtwVjbe-.js → index.BNNR5Jmd.js} +1 -1
  47. streamlit/static/static/js/{index.DtpZrdsz.js → index.BONHiJUZ.js} +1 -1
  48. streamlit/static/static/js/{index.CZ6f-p0K.js → index.BR-S54Iv.js} +1 -1
  49. streamlit/static/static/js/{index.B0GUCtHl.js → index.BV38yp5k.js} +1 -1
  50. streamlit/static/static/js/{index.BV-8GugV.js → index.BWTBe3a1.js} +1 -1
  51. streamlit/static/static/js/{index.BMWx_YQD.js → index.BfusYuD8.js} +1 -1
  52. streamlit/static/static/js/{index.CWweAMBx.js → index.BkLkRTpZ.js} +1 -1
  53. streamlit/static/static/js/{index.p5qVS5RU.js → index.C5KKmyWy.js} +1 -1
  54. streamlit/static/static/js/{index.CzMgwzgb.js → index.CJ-XXd1r.js} +1 -1
  55. streamlit/static/static/js/{index.BgmEuudT.js → index.COBionvf.js} +1 -1
  56. streamlit/static/static/js/{index.BfcdLS9y.js → index.CWgnk1N4.js} +1 -1
  57. streamlit/static/static/js/{index.whcmqOYZ.js → index.CZ5fZcT5.js} +1 -1
  58. streamlit/static/static/js/{index.CTVSiPCo.js → index.C_2m4F7k.js} +1 -1
  59. streamlit/static/static/js/{index.DP7RHJHC.js → index.CgOynO1t.js} +1 -1
  60. streamlit/static/static/js/{index.BEfxU01i.js → index.CjBaoWYr.js} +1 -1
  61. streamlit/static/static/js/{index.muQ-sA7D.js → index.CkKptP1T.js} +1 -1
  62. streamlit/static/static/js/{index.VVmp3qV7.js → index.D4XRYl23.js} +1 -1
  63. streamlit/static/static/js/{index.Cpz3pp0B.js → index.DAvhwYMG.js} +1 -1
  64. streamlit/static/static/js/{index.B6guKn0h.js → index.DIyx-z1Q.js} +1 -1
  65. streamlit/static/static/js/{index.DH2YAEv6.js → index.DOYomqqU.js} +1 -1
  66. streamlit/static/static/js/{index.CPiByGGr.js → index.DOl-SOKu.js} +1 -1
  67. streamlit/static/static/js/{index.BsiojTxz.js → index.DQGSbu2C.js} +1 -1
  68. streamlit/static/static/js/{index.CVxkW_lc.js → index.DTU7qmDP.js} +1 -1
  69. streamlit/static/static/js/{index.B3Y99Usz.js → index.DdyZtGcg.js} +1 -1
  70. streamlit/static/static/js/{index.YePOPnW6.js → index.DwUISpCs.js} +5 -5
  71. streamlit/static/static/js/{index.BvWDoWjf.js → index.I3iNnzJx.js} +1 -1
  72. streamlit/static/static/js/{index.3HscCA0Q.js → index.WWYmGCrM.js} +1 -1
  73. streamlit/static/static/js/{index.kWUcv9pK.js → index._BaeK1t7.js} +1 -1
  74. streamlit/static/static/js/{index.BXfm7UZe.js → index.gBOr8z2K.js} +1 -1
  75. streamlit/static/static/js/{index.CLFnBokZ.js → index.p2Wl4zMi.js} +1 -1
  76. streamlit/static/static/js/{index.R5J-UXhx.js → index.vOqxh1m2.js} +1 -1
  77. streamlit/static/static/js/{input.C95vVzrH.js → input.BvD9DHLa.js} +1 -1
  78. streamlit/static/static/js/{memory.lfILky3m.js → memory.DCVB1HOm.js} +1 -1
  79. streamlit/static/static/js/{mergeWith.CdpKbzWl.js → mergeWith.BqTORFAq.js} +1 -1
  80. streamlit/static/static/js/{number-overlay-editor.D2TjUrKf.js → number-overlay-editor.VB_OvuPv.js} +1 -1
  81. streamlit/static/static/js/{possibleConstructorReturn.DQV58bYB.js → possibleConstructorReturn.DhYxBDlj.js} +1 -1
  82. streamlit/static/static/js/{sandbox.R1dhBCnm.js → sandbox.CoN7LRFk.js} +1 -1
  83. streamlit/static/static/js/{textarea.t5D4QCw3.js → textarea.DkHpIjdT.js} +1 -1
  84. streamlit/static/static/js/{timepicker.BI9iPIxz.js → timepicker.C8UIzYhf.js} +1 -1
  85. streamlit/static/static/js/{toConsumableArray.COyXrPhy.js → toConsumableArray.DXfr1fvT.js} +1 -1
  86. streamlit/static/static/js/{uniqueId.CaWObuU_.js → uniqueId.CgrMSBTb.js} +1 -1
  87. streamlit/static/static/js/{useBasicWidgetState.Wd2TSACf.js → useBasicWidgetState.C-e-WEFS.js} +1 -1
  88. streamlit/static/static/js/{useOnInputChange.CUFXty-S.js → useOnInputChange.CtRJhZD6.js} +1 -1
  89. streamlit/static/static/js/{withFullScreenWrapper.wgkD5MeK.js → withFullScreenWrapper.od0SAvAK.js} +1 -1
  90. streamlit/watcher/path_watcher.py +3 -2
  91. streamlit/web/bootstrap.py +1 -1
  92. streamlit/web/server/server.py +1 -1
  93. {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/METADATA +2 -2
  94. {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/RECORD +98 -98
  95. {streamlit_nightly-1.45.2.dev20250526.data → streamlit_nightly-1.45.2.dev20250527.data}/scripts/streamlit.cmd +0 -0
  96. {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/WHEEL +0 -0
  97. {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/entry_points.txt +0 -0
  98. {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.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(f"Unable to display code. {err}")
104
+ show_warning("Unable to display code. %s" % err)
105
105
 
106
106
 
107
107
  def _get_initial_indent(lines: Iterable[str]) -> int:
streamlit/config.py CHANGED
@@ -1301,8 +1301,7 @@ 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
- msg = f'Config key "{key}" not defined.'
1305
- raise RuntimeError(msg)
1304
+ raise RuntimeError('Config key "%s" not defined.' % key)
1306
1305
  return config_options[key].where_defined
1307
1306
 
1308
1307
 
@@ -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 = f"Replaced by {self.replaced_by}."
192
+ deprecation_text = "Replaced by %s." % 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(f"[{section}]")
87
+ append_section("[%s]" % section)
88
88
  out.append("")
89
89
 
90
90
  for option in section_options.values():
@@ -125,7 +125,8 @@ def show_config(
125
125
  append_comment(line)
126
126
  append_comment("")
127
127
  append_comment(
128
- f"This option will be removed on or after {option.expiration_date}."
128
+ "This option will be removed on or after %s."
129
+ % option.expiration_date
129
130
  )
130
131
 
131
132
  import toml
@@ -137,7 +138,7 @@ def show_config(
137
138
  # Ensure a line break before appending "Default" comment, if not already there
138
139
  if out[-1] != "#":
139
140
  append_comment("")
140
- append_comment(f"Default: {toml_default}")
141
+ append_comment("Default: %s" % toml_default)
141
142
  else:
142
143
  # Don't say "Default: (unset)" here because this branch applies
143
144
  # to complex config settings too.
@@ -150,7 +151,7 @@ def show_config(
150
151
  if option_is_manually_set:
151
152
  if out[-1] != "# ":
152
153
  append_comment("")
153
- append_comment(f"The value below was set in {option.where_defined}")
154
+ append_comment("The value below was set in %s" % option.where_defined)
154
155
 
155
156
  toml_setting = toml.dumps({key: option.value})
156
157
 
@@ -237,10 +237,18 @@ def _format_syntax_error_message(exception: SyntaxError) -> str:
237
237
  )
238
238
 
239
239
  return (
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}"
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
+ }
244
252
  )
245
253
  # If a few edge cases, SyntaxErrors don't have all these nice fields. So we
246
254
  # have a fall back here.
@@ -141,7 +141,7 @@ def marshall(
141
141
  engine = "dot"
142
142
  else:
143
143
  raise StreamlitAPIException(
144
- f"Unhandled type for graphviz chart: {type(figure_or_dot)}"
144
+ "Unhandled type for graphviz chart: %s" % type(figure_or_dot)
145
145
  )
146
146
 
147
147
  proto.spec = dot
@@ -286,13 +286,14 @@ class HeadingMixin:
286
286
  proto.anchor = anchor
287
287
  elif anchor is True: # type: ignore
288
288
  raise StreamlitAPIException(
289
- f"Anchor parameter has invalid value: {anchor}. "
290
- "Supported values: None, any string or False"
289
+ "Anchor parameter has invalid value: %s. "
290
+ "Supported values: None, any string or False" % anchor
291
291
  )
292
292
  else:
293
293
  raise StreamlitAPIException(
294
- f"Anchor parameter has invalid type: {type(anchor).__name__}. "
294
+ "Anchor parameter has invalid type: %s. "
295
295
  "Supported values: None, any string or False"
296
+ % type(anchor).__name__
296
297
  )
297
298
 
298
299
  if help:
@@ -160,7 +160,8 @@ 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
- f"Channel can only be 1, 3, or 4 got {shape[-1]}. Shape is {shape}"
163
+ "Channel can only be 1, 3, or 4 got %d. Shape is %s"
164
+ % (shape[-1], str(shape))
164
165
  )
165
166
 
166
167
  # If there's only one channel, convert is to x, y
@@ -436,7 +437,7 @@ def marshall_images(
436
437
 
437
438
  # We use the index of the image in the input image list to identify this image inside
438
439
  # MediaFileManager. For this, we just add the index to the image's "coordinates".
439
- image_id = f"{coordinates}-{coord_suffix}"
440
+ image_id = "%s-%i" % (coordinates, coord_suffix)
440
441
 
441
442
  proto_img.url = image_to_url(
442
443
  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 = f"$$\n{clean_text(body)}\n$$"
255
+ latex_proto.body = "$$\n%s\n$$" % clean_text(body)
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(f"Invalid binary data format: {type(data)}")
481
+ raise RuntimeError("Invalid binary data format: %s" % 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
- f"Progress Value has invalid value [0, 100]: {value}"
69
+ "Progress Value has invalid value [0, 100]: %d" % 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
- f"Progress Value has invalid value [0.0, 1.0]: {value}"
76
+ "Progress Value has invalid value [0.0, 1.0]: %f" % value
77
77
  )
78
78
  raise StreamlitAPIException(
79
- f"Progress Value has invalid type: {type(value).__name__}"
79
+ "Progress Value has invalid type: %s" % 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(f"Invalid binary data format: {type(data)}")
1108
+ raise StreamlitAPIException("Invalid binary data format: %s" % type(data))
1109
1109
 
1110
1110
  if runtime.exists():
1111
1111
  file_url = runtime.get_instance().media_file_mgr.add(
@@ -206,19 +206,25 @@ class ColorPickerMixin:
206
206
 
207
207
  # make sure the value is a string
208
208
  if not isinstance(value, str):
209
- raise StreamlitAPIException(f"""
210
- Color Picker Value has invalid type: {type(value).__name__}. Expects a hex string
211
- like '#00FFAA' or '#000'.
212
- """)
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
+ )
213
216
 
214
217
  # validate the value and expects a hex string
215
218
  match = re.match(r"^#(?:[0-9a-fA-F]{3}){1,2}$", value)
216
219
 
217
220
  if not match:
218
- raise StreamlitAPIException(f"""
219
- '{value}' is not a valid hex code for colors. Valid ones are like
220
- '#00FFAA' or '#000'.
221
- """)
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
+ )
222
228
 
223
229
  color_picker_proto = ColorPickerProto()
224
230
  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
- f"Radio Value has invalid type: {type(index).__name__}"
354
+ "Radio Value has invalid type: %s" % 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
- f"Selectbox Value has invalid type: {type(index).__name__}"
498
+ "Selectbox Value has invalid type: %s" % 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,13 +813,17 @@ class SliderMixin:
813
813
  )
814
814
 
815
815
  if not int_args and not float_args and not timelike_args:
816
- msg = (
816
+ raise StreamlitAPIException(
817
817
  "Slider value arguments must be of matching types."
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."
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
+ }
821
826
  )
822
- raise StreamlitAPIException(msg)
823
827
 
824
828
  # Ensure that the value matches arguments' types.
825
829
  all_ints = data_type == SliderProto.INT and int_args
@@ -827,13 +831,17 @@ class SliderMixin:
827
831
  all_timelikes = data_type in TIMELIKE_TYPES and timelike_args
828
832
 
829
833
  if not all_ints and not all_floats and not all_timelikes:
830
- msg = (
834
+ raise StreamlitAPIException(
831
835
  "Both value and arguments must be of the same type."
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."
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
+ }
835
844
  )
836
- raise StreamlitAPIException(msg)
837
845
 
838
846
  # Ensure that min <= value(s) <= max, adjusting the bounds as necessary.
839
847
  min_value = min(min_value, max_value)
@@ -369,7 +369,8 @@ class TextWidgetsMixin:
369
369
  text_input_proto.type = TextInputProto.PASSWORD
370
370
  else:
371
371
  raise StreamlitAPIException(
372
- f"'{type}' is not a valid text_input type. Valid types are 'default' and 'password'."
372
+ "'%s' is not a valid text_input type. Valid types are 'default' and 'password'."
373
+ % type
373
374
  )
374
375
 
375
376
  # 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(f"Frame {frame_num + 1}/100")
45
+ frame_text.text("Frame %i/100" % (frame_num + 1))
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
- f"example-data/master/hello/v1/{filename}"
29
+ "example-data/master/hello/v1/%s" % filename
30
30
  )
31
31
  return pd.read_json(url)
32
32
 
@@ -95,10 +95,11 @@ 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
- f"""
98
+ """
99
99
  **This demo requires internet access.**
100
- Connection error: {e.reason}
100
+ Connection error: %s
101
101
  """
102
+ % e.reason
102
103
  )
103
104
 
104
105
 
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 = f'undefined log level "{level}"'
49
+ msg = 'undefined log level "%s"' % level
50
50
  logger.critical(msg)
51
51
  sys.exit(1)
52
52
 
@@ -92,25 +92,26 @@ class UserHashError(StreamlitAPIException):
92
92
  args = self._get_error_message_args(orig_exc, cached_func)
93
93
 
94
94
  return (
95
- f"""
96
- {args["orig_exception_desc"]}
95
+ """
96
+ %(orig_exception_desc)s
97
97
 
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"]}.
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.
101
101
 
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,
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,
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
- {args["hash_stack"]}
108
+ %(hash_stack)s
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
114
115
  ).strip("\n")
115
116
 
116
117
  def _get_error_message_args(
@@ -263,28 +263,41 @@ 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 = f"""
267
- You can find our privacy policy at {cli_util.style_for_cli("https://streamlit.io/privacy-policy", underline=True)}
266
+ TELEMETRY_TEXT = """
267
+ You can find our privacy policy at %(link)s
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 {cli_util.style_for_cli(_CONFIG_FILE_PATH)},
274
+ - If you'd like to opt out, add the following to %(config)s,
275
275
  creating that file if necessary:
276
276
 
277
277
  [browser]
278
278
  gatherUsageStats = false
279
- """
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
+ }
280
285
 
281
286
  cli_util.print_to_cli(TELEMETRY_TEXT)
282
287
  if show_instructions:
283
288
  # IMPORTANT: Break the text below at 80 chars.
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
- """
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
+ }
288
301
 
289
302
  cli_util.print_to_cli(INSTRUCTIONS_TEXT)
290
303
  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.YePOPnW6.js"></script>
54
+ <script type="module" crossorigin src="./static/js/index.DwUISpCs.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.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
+ 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 +1 @@
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};
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};