浏览代码

doc update

wangweimin 4 年之前
父节点
当前提交
69a6bc5d4e
共有 5 个文件被更改,包括 8 次插入8 次删除
  1. 2 2
      docs/guide.rst
  2. 1 1
      pywebio/platform/aiohttp.py
  3. 2 2
      pywebio/platform/django.py
  4. 2 2
      pywebio/platform/flask.py
  5. 1 1
      pywebio/platform/tornado.py

+ 2 - 2
docs/guide.rst

@@ -480,7 +480,7 @@ PyWebIO 目前支持与Flask、Tornado、Django和aiohttp Web框架的集成。
             app = Flask(__name__)
 
             # task_func 为使用PyWebIO编写的任务函数
-            app.add_url_rule('/io', 'webio_view', webio_view(target=task_func),
+            app.add_url_rule('/io', 'webio_view', webio_view(task_func),
                         methods=['GET', 'POST', 'OPTIONS'])  # 接口需要能接收GET、POST和OPTIONS请求
 
             @app.route('/')
@@ -508,7 +508,7 @@ PyWebIO 目前支持与Flask、Tornado、Django和aiohttp Web框架的集成。
             from pywebio.platform.django import webio_view
 
             # task_func 为使用PyWebIO编写的任务函数
-            webio_view_func = webio_view(target=task_func)
+            webio_view_func = webio_view(task_func)
 
             urlpatterns = [
                 path(r"io", webio_view_func),  # http通信接口

+ 1 - 1
pywebio/platform/aiohttp.py

@@ -158,7 +158,7 @@ def start_server(applications, port=0, host='', debug=False,
                  auto_open_webbrowser=False,
                  websocket_settings=None,
                  **aiohttp_settings):
-    """启动一个 aiohttp server 将 ``target`` 任务函数作为Web服务提供。
+    """启动一个 aiohttp server 将PyWebIO应用作为Web服务提供。
 
     :param list/dict/callable applications: PyWebIO应用. 可以是任务函数或者任务函数的字典或列表。
     :param list allowed_origins: 除当前域名外,服务器还允许的请求的来源列表。

+ 2 - 2
pywebio/platform/django.py

@@ -118,7 +118,7 @@ def start_server(applications, port=8080, host='localhost',
                  session_cleanup_interval=None,
                  session_expire_seconds=None,
                  debug=False, **django_options):
-    """启动一个 Django server 将 ``target`` 任务函数作为Web服务提供。
+    """启动一个 Django server 将PyWebIO应用作为Web服务提供。
 
     :param list/dict/callable applications: PyWebIO应用. 可以是任务函数或者任务函数的字典或列表。
     :param int port: server bind port. set ``0`` to find a free port number to use
@@ -135,7 +135,7 @@ def start_server(applications, port=8080, host='localhost',
         比如 ``https://*.example.com`` 、 ``*://*.example.com``
     :param callable check_origin: 请求来源检查函数。接收请求来源(包含协议和域名和端口部分)字符串,
         返回 ``True/False`` 。若设置了 ``check_origin`` , ``allowed_origins`` 参数将被忽略
-    :param bool disable_asyncio: 禁用 asyncio 函数。仅在 ``target`` 为协程函数时有效。
+    :param bool disable_asyncio: 禁用 asyncio 函数。仅在任务函数为协程函数时有效。
 
        .. note::  实现说明:
            当使用Django backend时,若要在PyWebIO的会话中使用 ``asyncio`` 标准库里的协程函数,PyWebIO需要单独开启一个线程来运行 ``asyncio`` 事件循环,

+ 2 - 2
pywebio/platform/flask.py

@@ -119,7 +119,7 @@ def start_server(applications, port=8080, host='localhost',
                  session_cleanup_interval=None,
                  session_expire_seconds=None,
                  debug=False, **flask_options):
-    """启动一个 Flask server 将 ``target`` 任务函数作为Web服务提供。
+    """启动一个 Flask server 将PyWebIO应用作为Web服务提供。
 
     :param list/dict/callable applications: PyWebIO应用. 可以是任务函数或者任务函数的字典或列表。
     :param int port: server bind port. set ``0`` to find a free port number to use
@@ -136,7 +136,7 @@ def start_server(applications, port=8080, host='localhost',
         比如 ``https://*.example.com`` 、 ``*://*.example.com``
     :param callable check_origin: 请求来源检查函数。接收请求来源(包含协议和域名和端口部分)字符串,
         返回 ``True/False`` 。若设置了 ``check_origin`` , ``allowed_origins`` 参数将被忽略
-    :param bool disable_asyncio: 禁用 asyncio 函数。仅在 ``target`` 为协程函数时有效。
+    :param bool disable_asyncio: 禁用 asyncio 函数。仅在任务函数为协程函数时有效。
 
        .. note::  实现说明:
            当使用Flask backend时,若要在PyWebIO的会话中使用 ``asyncio`` 标准库里的协程函数,PyWebIO需要单独开启一个线程来运行 ``asyncio`` 事件循环,

+ 1 - 1
pywebio/platform/tornado.py

@@ -173,7 +173,7 @@ def start_server(applications, port=0, host='', debug=False,
                  websocket_ping_interval=None,
                  websocket_ping_timeout=None,
                  **tornado_app_settings):
-    """启动一个 Tornado server 将 ``target`` 任务函数作为Web服务提供。
+    """启动一个 Tornado server 将PyWebIO应用作为Web服务提供。
 
     :param list/dict/callable applications: PyWebIO应用. 可以是任务函数或者任务函数的字典或列表。