Skip to content

Commit

Permalink
Set installed traitlets of pseudo/qe install widget when it's done (#262
Browse files Browse the repository at this point in the history
)

After PR #251 there is an issue that `SSSPInstallWidget` can not update the state to installed even if the pseudo libraries are properly installed.
The reason is that SSSPInstallWidget once updates the installed traitlets in `_refresh_installed` but not in the new implementation.
The way to fix this is to set the `installed` state if function `install()` finished okay.
  • Loading branch information
unkcpz authored Aug 8, 2022
1 parent 59e6255 commit 0759636
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions aiidalab_qe/setup_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,12 @@ def _refresh_installed(self):
for msg in install():
self.set_message(msg)

self.installed = True

except Exception as error:
self.set_message("Failed to setup QE on localhost.")
self.set_trait("error", str(error))
FN_DO_NOT_SETUP.touch()
else:
self.set_trait("installed", True)
self.set_message("OK")
finally:
self.set_trait("busy", False)
Expand Down
2 changes: 2 additions & 0 deletions aiidalab_qe/sssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def _refresh_installed(self):
self.set_trait("error", str(error))
self.set_message(str(error))
else:
# If all the libraries are install by hands `pseudos_to_install()` will be empty list.
self.set_trait("installed", not bool(pseudos_to_install()))
self.set_message("OK")
finally:
self.set_trait("busy", False)
Expand Down

0 comments on commit 0759636

Please sign in to comment.