Dynamic explanation in components
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user