Skip to content

Commit

Permalink
fix logbox_clear
Browse files Browse the repository at this point in the history
  • Loading branch information
wang0618 authored May 23, 2024
1 parent aeee3a9 commit be974de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pywebio_battery/__version__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__package__ = 'pywebio_battery'
__description__ = 'Utilities that help write PyWebIO apps quickly and easily.'
__url__ = 'https://pywebio.readthedocs.io/en/latest/battery.html'
__version__ = "0.6.0"
__version_info__ = (0, 6, 0, 0)
__version__ = "0.6.1"
__version_info__ = (0, 6, 1, 0)
__author__ = 'WeiminWang'
__author_email__ = '[email protected]'
__license__ = 'MIT'
2 changes: 1 addition & 1 deletion pywebio_battery/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def logbox_append(name: str, text: str):

def logbox_clear(name: str):
"""Clear all contents of a logbox widget"""
pywebio.session.run_js('$("#webio-logbox-%s").empty()' % name)
run_js('$("#webio-logbox-%s").empty()' % name)


def put_video(src: Union[str, bytes], autoplay: bool = False, loop: bool = False,
Expand Down
2 changes: 2 additions & 0 deletions pywebio_battery/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def get_localstorage(key: str) -> str:
"""Get the key's value in user's web browser local storage"""
return eval_js("localStorage.getItem(key)", key=key)


def clear_localstorage():
"""Clear user's web browser local storage"""
return eval_js("localStorage.clear()")


def _init_cookie_client():
session = get_current_session()
if 'cookie_client_flag' not in session.internal_save:
Expand Down

0 comments on commit be974de

Please sign in to comment.