Dynamic explanation in components

This commit is contained in:
MaXFeeD
2025-04-19 10:32:43 +03:00
parent e43183f5c0
commit 8dbf6b3ffe
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class HttpConnection10:
pass
def retrieve_stream(input: IO[bytes], output: Optional[IO[bytes]] = None, /, chunk_size: int = 8192, progress_handler: Optional[Callable[[int], None]] = None) -> int:
if chunk_size < -1 or chunk_size == 0:
if chunk_size != -1 and chunk_size < 1:
raise ValueError(f"chunk_size should be > 0 or == -1, got {chunk_size}!")
with input as stream:
received = 0
+2 -2
View File
@@ -171,7 +171,7 @@ class Input(Feedback):
idle_selector_text="",
focused_selector_text=""
)
self.explanation_control = Interactable(text=self.explanation, style="class:editable.hint")
self.explanation_control = Interactable(text=lambda: self.explanation, style="class:editable.hint")
return HSplit([
self.input_control,
@@ -270,7 +270,7 @@ class Select(Feedback):
self.focused_interactable = interactable
self.choice_variants.append(interactable)
which_offset += 1
self.explanation_control = Interactable(text=self.explanation, style="class:editable.hint")
self.explanation_control = Interactable(text=lambda: self.explanation, style="class:editable.hint")
return HSplit([
Interactable(self.prompt),