Skip to content

Commit

Permalink
Disable(enable) download controls when downloading(done)
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 19, 2024
1 parent 36e7881 commit d67bbcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _download_data(self, button_instance):
Args:
button_instance (ipywidgets.Button): The button instance that was clicked.
"""

button_instance.disabled = True
if "archive" in button_instance.description:
what = "archive"
filename = f"export_qeapp_calculation_pk_{self.node.pk}.aiida"
Expand All @@ -97,6 +97,7 @@ def _download_data(self, button_instance):
self._download(payload=data, filename=filename)
del data
box.children = box.children[:1]
button_instance.disabled = False

@staticmethod
def _download(payload, filename):
Expand Down
13 changes: 0 additions & 13 deletions src/aiidalab_qe/app/result/components/summary/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ def __init__(self, node, export_dir=None, **kwargs):
Creating archive...
</button>"""
)
self._download_archive_button = ipw.Button(
description="Download output",
icon="download",
)
self._download_archive_button.on_click(self._download_archive)
self._download_button_widget = DownloadDataWidget(workchain_node=self.node)

if node.exit_status != 0:
Expand Down Expand Up @@ -79,14 +74,6 @@ def __init__(self, node, export_dir=None, **kwargs):
def _default_busy(self):
return False

@tl.observe("_busy")
def _observe_busy(self, change):
self._download_button_container.children = [
self._create_archive_indicator
if change["new"]
else self._download_archive_button
]

def _download_archive(self, _):
fn_archive = self.export_dir.joinpath(str(self.node.uuid)).with_suffix(".zip")
fn_lockfile = fn_archive.with_suffix(".lock")
Expand Down

0 comments on commit d67bbcc

Please sign in to comment.