Skip to content

Commit

Permalink
Remove the workaround decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Dec 2, 2024
1 parent 143c5e5 commit 96f9885
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions home/start_page.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Module to generate AiiDAlab home page."""

import json
from functools import wraps
from glob import glob
from os import path

Expand Down Expand Up @@ -29,31 +28,6 @@ def create_app_widget_move_buttons(name):
return app_widget_move_buttons


def _workaround_property_lock_issue(func):
"""Work-around for issue with the ipw.Accordion widget.
The widget does not report changes to the .selected_index trait when displayed
within a custom ipw.Output instance. However, the change is somewhat cryptic reported
by a change to the private '_property_lock' trait. We observe changes to that trait
and convert the change argument into a form that is more like the one expected by
downstream handlers.
"""

@wraps(func)
def _inner(self, change):
if change["name"] == "_property_lock":
if "selected_index" in change["old"]:
fixed_change = change.copy()
fixed_change["name"] = "selected_index"
fixed_change["new"] = change["old"]["selected_index"]
del fixed_change["old"]
return func(self, fixed_change)

return func(self, change)

return _inner


class AiidaLabHome:
"""Class that mananges the appearance of the AiiDAlab home page."""

Expand Down

0 comments on commit 96f9885

Please sign in to comment.