1
0
Эх сурвалжийг харах

Fix typos discovered by codespell

Christian Clauss 3 жил өмнө
parent
commit
cd12617375

+ 4 - 0
.github/workflows/lint.yml

@@ -13,6 +13,10 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
+      - uses: codespell-project/actions-codespell@master
+        with:
+          ignore_words_list: datas
+          skip: "*.js,*.po"
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v1
         with:

+ 3 - 3
pywebio/output.py

@@ -167,7 +167,7 @@ index equal ``position``:
     Output Messages.
 
     :param contents: Message contents.
-       The item is ``put_xxx()`` call, and any other type will be coverted to ``put_text(content)``.
+       The item is ``put_xxx()`` call, and any other type will be converted to ``put_text(content)``.
     :param bool closable: Whether to show a dismiss button on the right of the message.
     :param int scope, position: Those arguments have the same meaning as for `put_text()`
 
@@ -402,7 +402,7 @@ def put_info(*contents, closable=False, scope=None, position=OutputPosition.BOTT
     """Output information message.
 
     :param contents: Message contents.
-       The item is ``put_xxx()`` call, and any other type will be coverted to ``put_text(content)``.
+       The item is ``put_xxx()`` call, and any other type will be converted to ``put_text(content)``.
     :param bool closable: Whether to show a dismiss button on the right of the message.
     :param int scope, position: Those arguments have the same meaning as for `put_text()`
 
@@ -1414,7 +1414,7 @@ def output(*contents):
      and after being output, the content can also be modified by the handler (See code example below).
 
     :param contents: The initial contents to be output.
-       The item is ``put_xxx()`` call, and any other type will be coverted to ``put_text(content)``.
+       The item is ``put_xxx()`` call, and any other type will be converted to ``put_text(content)``.
     :return: An OutputHandler instance, the methods of the instance are as follows:
 
     * ``reset(*contents)`` : Reset original contents to ``contents``

+ 2 - 2
pywebio/platform/aiohttp.py

@@ -23,8 +23,8 @@ def _check_origin(origin, allowed_origins, host):
         return True
 
     return any(
-        fnmatch.fnmatch(origin, patten)
-        for patten in allowed_origins
+        fnmatch.fnmatch(origin, pattern)
+        for pattern in allowed_origins
     )
 
 

+ 2 - 2
pywebio/platform/httpbased.py

@@ -310,8 +310,8 @@ class HttpHandler:
 
         if check_origin is None:
             self.check_origin = lambda origin: any(
-                fnmatch.fnmatch(origin, patten)
-                for patten in (allowed_origins or [])
+                fnmatch.fnmatch(origin, pattern)
+                for pattern in (allowed_origins or [])
             )
 
 

+ 2 - 2
pywebio/platform/tornado.py

@@ -49,8 +49,8 @@ def _check_origin(origin, allowed_origins, handler: WebSocketHandler):
         return True
 
     return any(
-        fnmatch.fnmatch(origin, patten)
-        for patten in allowed_origins
+        fnmatch.fnmatch(origin, pattern)
+        for pattern in allowed_origins
     )
 
 

+ 3 - 3
pywebio/platform/utils.py

@@ -194,7 +194,7 @@ def make_applications(applications):
     elif not isinstance(applications, Mapping):  # 单一任务函数 类型
         applications = {'index': applications}
 
-    # covert dict key to str
+    # convert dict key to str
     applications = {str(k): v for k, v in applications.items()}
 
     for app in applications.values():
@@ -215,8 +215,8 @@ class OriginChecker:
             return True
 
         return any(
-            fnmatch.fnmatch(origin, patten)
-            for patten in allowed_origins
+            fnmatch.fnmatch(origin, pattern)
+            for pattern in allowed_origins
         )
 
     @staticmethod