From 964f3a40f03537899c0d564d9908e5c8afe69596 Mon Sep 17 00:00:00 2001 From: AN Long Date: Wed, 12 Jun 2024 18:22:30 +0800 Subject: [PATCH] Fix typos in comments, docs and tests --- CHANGES.rst | 8 ++++---- tests/addressbook.py | 2 +- tests/compatible/version_2/tracking.py | 2 +- tests/container.py | 2 +- tests/test_rpc.py | 2 +- thriftpy2/contrib/tracking/__init__.py | 2 +- thriftpy2/hook.py | 2 +- thriftpy2/parser/parser.py | 4 ++-- thriftpy2/transport/base.py | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index cee1a569..b2b5feaa 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -185,7 +185,7 @@ Version 0.4.5 Released on August 27, 2019. - Support kwargs style parameters passing in TSimpleServer, via `2-#67`_. -- Fix #65 allow double const to ommit integer part, via `2-#66`_. +- Fix #65 allow double const to omit integer part, via `2-#66`_. .. _2-#67: https://github.com/Thriftpy/thriftpy2/pull/67 .. _2-#66: https://github.com/Thriftpy/thriftpy2/pull/66 @@ -461,7 +461,7 @@ Released on April 15, 2015. - add limitation on thrift reserved keyword for compatible with upstream, via `#115`_. - bugfix EOF grammar error, via `#103`_. -- bugfix for mis-mach transport in client caused server crash, via `#119`_. +- bugfix for mismatch transport in client caused server crash, via `#119`_. - bugfix for typedef on included thrift files, via `#121`_. .. _`#96`: https://github.com/eleme/thriftpy/pull/96 @@ -487,7 +487,7 @@ Released on March 3, 2015. - bugfix for transport clean in read_struct in cybin, via `#70`_. - bugfix for large reading size in framed transport, via `#73`_. - bugfix for cython build failed in older CentOS, via `#92`_. -- bugfix for thrift file version mis-match caused message corrupt in +- bugfix for thrift file version mismatch caused message corrupt in `read_struct`, via `#95`_. Non-Backward Compatible changes: @@ -719,7 +719,7 @@ Released on June 7, 2014. - disabled the magic import hook by default. and add install/remove function to switch the hook on and off. - reworked benchmark suit and add benchmark results. -- new `__init__` function code generator. get a noticable speed boost. +- new `__init__` function code generator. get a noticeable speed boost. - bug fixes diff --git a/tests/addressbook.py b/tests/addressbook.py index 5a17cfee..4db06b38 100644 --- a/tests/addressbook.py +++ b/tests/addressbook.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -"""This file is a demo for what the dynamiclly generated code would be like. +"""This file is a demo for what the dynamically generated code would be like. """ from thriftpy2.thrift import ( diff --git a/tests/compatible/version_2/tracking.py b/tests/compatible/version_2/tracking.py index 0abc9cab..da1bf066 100644 --- a/tests/compatible/version_2/tracking.py +++ b/tests/compatible/version_2/tracking.py @@ -36,7 +36,7 @@ def __init__(self, request_id, api, seq, client, server, status, start, :status: request status :start: start timestamp :end: end timestamp - :annotation: application-level key-value datas + :annotation: application-level key-value data """ self.request_id = request_id self.api = api diff --git a/tests/container.py b/tests/container.py index d9c5dda0..c7086ffd 100644 --- a/tests/container.py +++ b/tests/container.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -"""This file is a demo for what the dynamiclly generated code would be like. +"""This file is a demo for what the dynamically generated code would be like. """ from thriftpy2.thrift import ( diff --git a/tests/test_rpc.py b/tests/test_rpc.py index 38645005..fdd15981 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -279,7 +279,7 @@ def test_exception(): c.remove("Bob") -def test_exception_iwth_ssl(): +def test_exception_with_ssl(): with pytest.raises(addressbook.PersonNotExistsError): with ssl_client() as c: c.remove("Bob") diff --git a/thriftpy2/contrib/tracking/__init__.py b/thriftpy2/contrib/tracking/__init__.py index 0035e84a..2dc71062 100644 --- a/thriftpy2/contrib/tracking/__init__.py +++ b/thriftpy2/contrib/tracking/__init__.py @@ -37,7 +37,7 @@ def __init__(self, request_id, api, seq, client, server, status, start, :status: request status :start: start timestamp :end: end timestamp - :annotation: application-level key-value datas + :annotation: application-level key-value data """ self.request_id = request_id self.api = api diff --git a/thriftpy2/hook.py b/thriftpy2/hook.py index 6d709e19..014ee1b8 100644 --- a/thriftpy2/hook.py +++ b/thriftpy2/hook.py @@ -10,7 +10,7 @@ # TODO: The load process does not compatible with Python standard, e.g., if the -# specified thrift file does not exists, it raises FileNotFoundError, and skiped +# specified thrift file does not exists, it raises FileNotFoundError, and skipped # the other meta finders in the sys.meta_path. class ThriftImporter(importlib.abc.MetaPathFinder): def __init__(self, extension="_thrift"): diff --git a/thriftpy2/parser/parser.py b/thriftpy2/parser/parser.py index bd1bf6d3..a67d87fb 100644 --- a/thriftpy2/parser/parser.py +++ b/thriftpy2/parser/parser.py @@ -527,7 +527,7 @@ def parse(path, module_name=None, include_dirs=None, include_dir=None, the `include` directive, by default: ['.']. :param include_dir: directory to find child thrift files. Note this keyword parameter will be deprecated in the future, it exists - for compatiable reason. If it's provided (not `None`), + for compatible reason. If it's provided (not `None`), it will be appended to `include_dirs`. :param lexer: ply lexer to use, if not provided, `parse` will new one. :param parser: ply parser to use, if not provided, `parse` will new one. @@ -614,7 +614,7 @@ def parse_fp(source, module_name, lexer=None, parser=None, enable_cache=True): :param source: file-like object, expected to have a method named `read`. - :param module_name: the name for parsed module, shoule be endswith + :param module_name: the name for parsed module, should be endswith '_thrift'. :param lexer: ply lexer to use, if not provided, `parse` will new one. :param parser: ply parser to use, if not provided, `parse` will new one. diff --git a/thriftpy2/transport/base.py b/thriftpy2/transport/base.py index 5166322f..3060475d 100644 --- a/thriftpy2/transport/base.py +++ b/thriftpy2/transport/base.py @@ -61,7 +61,7 @@ def read(self, sz): def write(self, buf): """ - Submit some data to tbe written to the connection. May be + Submit some data to be written to the connection. May be buffered until flush is called. """ raise NotImplementedError