Skip to content

Commit 8a038df

Browse files
committed
doc update
1 parent 4fb9b03 commit 8a038df

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

pywebio/input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
SELECT = 'select'
9999
TEXTAREA = 'textarea'
100100

101-
__all__ = ['TEXT', 'NUMBER', 'FLOAT', 'PASSWORD', 'URL', 'DATE', 'TIME', 'input', 'textarea', 'select',
101+
__all__ = ['TEXT', 'NUMBER', 'FLOAT', 'PASSWORD', 'URL', 'DATE', 'TIME', 'COLOR', 'input', 'textarea', 'select',
102102
'checkbox', 'radio', 'actions', 'file_upload', 'slider', 'input_group', 'input_update']
103103

104104

@@ -205,7 +205,7 @@ def select_date(set_value):
205205
Note: When using :ref:`Coroutine-based session <coroutine_based_session>` implementation, the ``callback``
206206
function can be a coroutine function.
207207
208-
:param callable onchange: A callback function which will be called when the value of this input field changed.
208+
:param callable onchange: A callback function which will be called when user change the value of this input field.
209209
210210
The ``onchange`` callback is invoked with one argument, the current value of input field.
211211
A typical usage scenario of ``onchange`` is to update other input item by using `input_update()`

pywebio/pin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
Pin widgets value getter and setter.
9797
9898
You can use attribute or key index of ``pin`` object to get the current value of a pin widget.
99-
When accessing the value of a widget that does not exist, it returns ``None`` instead of throwing an exception.
99+
By default, when accessing the value of a widget that does not exist, it returns ``None`` instead of
100+
throwing an exception.
100101
101102
You can also use the ``pin`` object to set the value of pin widget:
102103
@@ -114,6 +115,8 @@
114115
Note: When using :ref:`coroutine-based session <coroutine_based_session>`,
115116
you need to use the ``await pin.name`` (or ``await pin['name']``) syntax to get pin widget value.
116117
118+
Use `pin.pin.use_strict()` to enable strict mode for getting pin widget value.
119+
An ``AssertionError`` will be raised when try to get value of pin widgets that are currently not in the page.
117120
118121
.. autofunction:: pin_wait_change
119122
.. autofunction:: pin_update

pywebio/platform/page.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,14 @@ def config(*, title=None, description=None, theme=None, js_code=None, js_file=[]
247247
If you use ``config()`` as decorator, the configuration will only work on single PyWebIO application function.
248248
::
249249
250-
config(title="My application")
250+
config(title="My application") # global configuration
251251
252-
@config(css_style="* { color:red }")
252+
@config(css_style="* { color:red }") # only works on this application
253253
def app():
254254
put_text("hello PyWebIO")
255255
256+
.. note:: The configuration will affect all sessions
257+
256258
``title`` and ``description`` are used for SEO, which are provided when indexed by search engines.
257259
If no ``title`` and ``description`` set for a PyWebIO application function,
258260
the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the function will be used as title and description by default::

0 commit comments

Comments
 (0)