-
-
Notifications
You must be signed in to change notification settings - Fork 572
Closed
Milestone
Description
Dear Panel team,
I'm facing an issue with the new FileDownload widget which I believe to be a bug, unless I'm doing a bad utilization of it. For info, I'm using Panel version 0.10.2.
Consider the following MWE:
import time
import panel as pn
pn.extension()
log_download1 = pn.widgets.FileDownload(button_type='success', label='Download log', disabled=True)
log_download2 = pn.widgets.Button(button_type='success', name='Download log', disabled=True)
def enable_button(button_obj):
for i in range(5):
time.sleep(1)
if i == 3:
button_obj.disabled = False
#then compare
enable_button(button_obj=log_download1)
#against
enable_button(button_obj=log_download2)Upon calling enable_button on log_download1 (FileDownload widget), the button won't get enabled when i == 3. Making the same for log_download2 (Button widget) works as expected: the button is created disabled and it gets enabled if a given condition is met. It is unfortunate if the same behavior can't be obtained using FileDownload since in my use case, I need to make the download available only when a given flag is found in a log file.
Hope it helps.
Thanks in advance,
Hugo
Metadata
Metadata
Assignees
Labels
No labels