Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web.py #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pywebio_battery/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from tornado.web import create_signed_value, decode_signed_value
from typing import *

__all__ = ['get_all_query', 'get_query', 'set_localstorage', 'get_localstorage', 'clear_localstorage', 'set_cookie', 'get_cookie',
__all__ = ['get_all_query', 'get_all_keys', 'get_query', 'set_localstorage', 'get_localstorage', 'clear_localstorage', 'set_cookie', 'get_cookie',
'basic_auth', 'custom_auth', 'revoke_auth']


Expand All @@ -15,6 +15,12 @@ def get_all_query():
return query


def get_all_keys():
"""Get all parameter keys"""
query = eval_js("Object.keys(localStorage)")
return query


def get_query(name: str):
"""Get URL parameter value"""
query = eval_js("new URLSearchParams(window.location.search).get(n)", n=name)
Expand Down
Loading