wangweimin 2 tahun lalu
induk
melakukan
75b477344c
4 mengubah file dengan 7 tambahan dan 15 penghapusan
  1. 0 6
      README-zh.md
  2. 0 6
      README.md
  3. 4 2
      pywebio/input.py
  4. 3 1
      pywebio/platform/flask.py

+ 0 - 6
README-zh.md

@@ -22,12 +22,6 @@
         <img src="https://img.shields.io/badge/python->%3D%203.5.2-brightgreen" alt="Python Version">
     </a>
     <br/>
-    <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:python">
-        <img src="https://img.shields.io/lgtm/grade/python/github/wang0618/PyWebIO.svg?colorB=brightgreen" alt="Python code quality">
-    </a>
-    <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:javascript">
-        <img src="https://img.shields.io/lgtm/grade/javascript/github/wang0618/PyWebIO.svg?colorB=brightgreen" alt="Javascript code quality">
-    </a>
     <a href="https://github.com/wang0618/PyWebIO/blob/master/LICENSE">
         <img src="https://img.shields.io/github/license/wang0618/PyWebIO.svg" alt="License">
     </a>

+ 0 - 6
README.md

@@ -22,12 +22,6 @@
         <img src="https://img.shields.io/badge/python->%3D%203.5.2-brightgreen" alt="Python Version">
     </a>
     <br/>
-    <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:python">
-        <img src="https://img.shields.io/lgtm/grade/python/github/wang0618/PyWebIO.svg?colorB=brightgreen" alt="Python code quality">
-    </a>
-    <a href="https://lgtm.com/projects/g/wang0618/PyWebIO/context:javascript">
-        <img src="https://img.shields.io/lgtm/grade/javascript/github/wang0618/PyWebIO.svg?colorB=brightgreen" alt="Javascript code quality">
-    </a>
     <a href="https://github.com/wang0618/PyWebIO/blob/master/LICENSE">
         <img src="https://img.shields.io/github/license/wang0618/PyWebIO.svg" alt="License">
     </a>

+ 4 - 2
pywebio/input.py

@@ -135,7 +135,7 @@ def _parse_args(kwargs, excludes=()):
 
 
 def input(label: str = '', type: str = TEXT, *, validate: Callable[[Any], Optional[str]] = None, name: str = None,
-          value: str = None,
+          value: Union[str, int] = None,
           action: Tuple[str, Callable[[Callable], None]] = None, onchange: Callable[[Any], None] = None,
           placeholder: str = None, required: bool = None,
           readonly: bool = None, datalist: List[str] = None, help_text: str = None, **other_html_attrs):
@@ -150,7 +150,9 @@ def input(label: str = '', type: str = TEXT, *, validate: Callable[[Any], Option
         user completes the input field or submits the form.
 
         ``validate`` receives the input value as a parameter. When the input value is valid, it returns ``None``.
-        When the input value is invalid, it returns an error message string. For example:
+        When the input value is invalid, it returns an error message string.
+
+        For example:
 
         .. exportable-codeblock::
             :name: input-valid-func

+ 3 - 1
pywebio/platform/flask.py

@@ -13,7 +13,7 @@ from . import page
 from .adaptor.http import HttpContext, HttpHandler, run_event_loop
 from .page import make_applications
 from .remote_access import start_remote_access_service
-from .utils import cdn_validation
+from .utils import cdn_validation, print_listen_address
 from ..session import Session
 from ..utils import STATIC_PATH, iscoroutinefunction, isgeneratorfunction
 from ..utils import get_free_port, parse_file_size
@@ -163,6 +163,8 @@ def start_server(applications, port=8080, host='', cdn=True,
                    check_origin=check_origin, session_expire_seconds=session_expire_seconds,
                    session_cleanup_interval=session_cleanup_interval, max_payload_size=max_payload_size)
 
+    print_listen_address(host, port)
+
     debug = Session.debug = os.environ.get('PYWEBIO_DEBUG', debug)
     if not debug:
         logging.getLogger('werkzeug').setLevel(logging.WARNING)