Преглед на файлове

Fix typos discovered by codespell

Christian Clauss преди 3 години
родител
ревизия
cd12617375
променени са 6 файла, в които са добавени 16 реда и са изтрити 12 реда
  1. 4 0
      .github/workflows/lint.yml
  2. 3 3
      pywebio/output.py
  3. 2 2
      pywebio/platform/aiohttp.py
  4. 2 2
      pywebio/platform/httpbased.py
  5. 2 2
      pywebio/platform/tornado.py
  6. 3 3
      pywebio/platform/utils.py

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

@@ -13,6 +13,10 @@ jobs:
 
 
     steps:
     steps:
       - uses: actions/checkout@v2
       - 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 }}
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v1
         uses: actions/setup-python@v1
         with:
         with:

+ 3 - 3
pywebio/output.py

@@ -167,7 +167,7 @@ index equal ``position``:
     Output Messages.
     Output Messages.
 
 
     :param contents: Message contents.
     :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 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()`
     :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.
     """Output information message.
 
 
     :param contents: Message contents.
     :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 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()`
     :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).
      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.
     :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:
     :return: An OutputHandler instance, the methods of the instance are as follows:
 
 
     * ``reset(*contents)`` : Reset original contents to ``contents``
     * ``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 True
 
 
     return any(
     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:
         if check_origin is None:
             self.check_origin = lambda origin: any(
             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 True
 
 
     return any(
     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):  # 单一任务函数 类型
     elif not isinstance(applications, Mapping):  # 单一任务函数 类型
         applications = {'index': applications}
         applications = {'index': applications}
 
 
-    # covert dict key to str
+    # convert dict key to str
     applications = {str(k): v for k, v in applications.items()}
     applications = {str(k): v for k, v in applications.items()}
 
 
     for app in applications.values():
     for app in applications.values():
@@ -215,8 +215,8 @@ class OriginChecker:
             return True
             return True
 
 
         return any(
         return any(
-            fnmatch.fnmatch(origin, patten)
-            for patten in allowed_origins
+            fnmatch.fnmatch(origin, pattern)
+            for pattern in allowed_origins
         )
         )
 
 
     @staticmethod
     @staticmethod