diff --git a/ipywatch/__init__.py b/ipywatch/__init__.py index 3b93d0b..27fdca4 100644 --- a/ipywatch/__init__.py +++ b/ipywatch/__init__.py @@ -1 +1 @@ -__version__ = "0.0.2" +__version__ = "0.0.3" diff --git a/ipywatch/ipywatch.py b/ipywatch/ipywatch.py index d10fec3..111a08c 100644 --- a/ipywatch/ipywatch.py +++ b/ipywatch/ipywatch.py @@ -4,11 +4,12 @@ __all__ = ['WidgetStateHistoryListener', 'Ipywatch'] # %% ../nbs/03_ipywatch.ipynb 3 -from typing import Any, Callable, List +from typing import Any, Callable import ipywidgets -from ipykernel.comm import Comm -from ipywidgets import HBox, VBox, Label, Output, Button, Text, Tab, Layout +from comm.base_comm import BaseComm +from ipywidgets.widgets import widget as widget_module +from ipywidgets import HBox, Output, Layout from ipywatch.history import WidgetStateHistory @@ -23,12 +24,12 @@ def __init__( self.history = WidgetStateHistory(history_size) self.on_state_change = on_state_change - _original_send = Comm.send + _original_send = BaseComm.send def _patched_send(comm, data=None, metadata=None, buffers=None): comm_id = comm.comm_id - widget = ipywidgets.Widget.widgets.get(comm_id) + widget = widget_module._instances.get(comm_id) self.history.set_state(comm_id, data) @@ -37,7 +38,7 @@ def _patched_send(comm, data=None, metadata=None, buffers=None): _original_send(comm, data, metadata, buffers) - Comm.send = _patched_send + BaseComm.send = _patched_send # %% ../nbs/03_ipywatch.ipynb 5 class Ipywatch(HBox): diff --git a/settings.ini b/settings.ini index 633fb35..4ac75c7 100644 --- a/settings.ini +++ b/settings.ini @@ -1,43 +1,37 @@ [DEFAULT] -# All sections below are required unless otherwise specified. -# See https://github.com/fastai/nbdev/blob/master/settings.ini for examples. - -### Python library ### repo = ipywatch -lib_name = %(repo)s -version = 0.0.2 +lib_name = ipywatch +version = 0.0.3 min_python = 3.9 license = apache2 black_formatting = False - -### nbdev ### doc_path = _docs lib_path = ipywatch nbs_path = nbs recursive = True tst_flags = notest put_version_in_init = True - -### Docs ### branch = main custom_sidebar = False -doc_host = https://%(user)s.github.io -doc_baseurl = /%(repo)s -git_url = https://github.com/%(user)s/%(repo)s -title = %(lib_name)s - -### PyPI ### +doc_host = https://itepifanio.github.io +doc_baseurl = /ipywatch +git_url = https://github.com/itepifanio/ipywatch +title = ipywatch audience = Developers author = Ítalo Epifânio author_email = italoepifaniols@gmail.com -copyright = 2024 onwards, %(author)s +copyright = 2024 onwards, Ítalo Epifânio description = A debugbar tool for ipywidgets/reacton/solara keywords = nbdev jupyter notebook python language = English status = 3 user = itepifanio - -### Optional ### requirements = ipykernel>=6.20.1 dev_requirements = solara>=1.26.1 -# console_scripts = \ No newline at end of file +readme_nb = index.ipynb +allowed_metadata_keys = +allowed_cell_metadata_keys = +jupyter_hooks = True +clean_ids = True +clear_all = False +