Skip to content

Commit a5625eb

Browse files
committed
Correct several typographical errors
1 parent 39094e0 commit a5625eb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

CaptureFile/CaptureFile.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CaptureFile:
7171
7272
An `InvalidCaptureFile` exception is raised if this constructor is used to
7373
open a file that is not a valid capture file, is in an unsupported version
74-
of the capture file format, or is a corruptted.
74+
of the capture file format, or is a corrupted.
7575
"""
7676

7777
_compression_level: ClassVar[int] = -1
@@ -546,7 +546,7 @@ def set_metadata(self, new_metadata: Optional[bytes], /):
546546
if not self.to_write:
547547
raise CaptureFileNotOpenForWrite(
548548
f'Cannot set the metadata of "{self.file_name}" because it is not open'
549-
" for writting."
549+
" for writing."
550550
)
551551

552552
self._metadata = new_metadata
@@ -581,7 +581,7 @@ def __getitem__(self, key: Union[int, slice], /) -> Union[List[Record], Record]:
581581
def record_generator(
582582
self, starting_record_number: int = 1
583583
) -> Generator[Record, None, None]:
584-
"""Returns a generator of records begining at `starting_record_number`
584+
"""Returns a generator of records beginning at `starting_record_number`
585585
that continues until the end of the file as it existed when
586586
`record_generator` was called.
587587
@@ -605,7 +605,7 @@ def record_generator(
605605
if starting_record_number < 1:
606606
raise IndexError
607607

608-
# only the rightmost path is mutable so grabing a copy of it ensures
608+
# only the rightmost path is mutable so grabbing a copy of it ensures
609609
# that the generator can continue to work even if records are inserted
610610
# after the generator was created although the new records will not be
611611
# returned. If that is desired then a new record_generator should be
@@ -724,7 +724,7 @@ def record_at(self, record_number: int, /) -> Record:
724724
if child_index != len(current_rightmost_node.children):
725725
break
726726

727-
# get first persistent child's data cooridnates. This child will refer
727+
# get first persistent child's data coordinates. This child will refer
728728
# to either the record or the root of a perfect sub-tree of which no
729729
# decendant can be a rightmost node of the top level tree.
730730
current_child_coordinates = current_rightmost_node.children[child_index]
@@ -781,7 +781,7 @@ def _write_full_pages(self, raw_bytes: bytes, /):
781781
page increments.
782782
783783
Remaining partial page data is held in the master node until next time
784-
when it is written as the begining of the first full page."""
784+
when it is written as the beginning of the first full page."""
785785

786786
assert self._file
787787
pos_in_last_page = self._file_limit() % self._config.page_size
@@ -841,7 +841,7 @@ def _coordinates_for_next_new_data_block(self, /) -> "DataCoordinates":
841841

842842
def _add_data_block(self, data_block: bytes, /) -> "DataCoordinates":
843843
"""Add the passed data block to the file without committing it and return its
844-
cooridnates"""
844+
coordinates"""
845845

846846
coordinates_for_new_record = self._coordinates_for_next_new_data_block()
847847
self._compression_block.write_sized(data_block)
@@ -870,7 +870,7 @@ def add_record(self, record: Record, /) -> int:
870870
if not self.to_write:
871871
raise CaptureFileNotOpenForWrite(
872872
f'Cannot add a record to "{self.file_name}" because it is not open for'
873-
" writting."
873+
" writing."
874874
)
875875

876876
self._current_master_node.rightmost_path.add_child_to_rightmost_node(
@@ -940,7 +940,7 @@ class CaptureFileConfiguration:
940940
directly from its constructor"""
941941

942942
version: int = 2
943-
"""The version indicates the compatability of code with file structure.
943+
"""The version indicates the compatibility of code with file structure.
944944
945945
Code with a version higher than the one stored in file should be capable of
946946
reading and writing to the file but a file with a higher version number than
@@ -969,7 +969,7 @@ class CaptureFileConfiguration:
969969
full_node_struct: Struct = field(init=False)
970970

971971
current_version: ClassVar[int] = 2
972-
"""The code's current verision which can support any earlier version
972+
"""The code's current version which can support any earlier version
973973
recorded in the file"""
974974

975975
capture_file_type: ClassVar[bytes] = b"MioCapture\0"
@@ -986,7 +986,7 @@ def __post_init__(self, /):
986986
self.master_node_size = self.page_size * 2 + self.compression_block_size
987987

988988
# The first master_node starts at page_size because the entire first
989-
# page is reserved for the permantent file metadata even though very
989+
# page is reserved for the permanent file metadata even though very
990990
# little of it is used. This fact is also used in
991991
# compress_and_flush_if_full to know for certain no writing is happening
992992
# on the first page after the file is created even across multiple OS
@@ -1056,7 +1056,7 @@ class MasterNode:
10561056
10571057
There are two MasterNodes recorded in the capture file so that there is
10581058
always a backup of the previous MasterNode if there is a problem while
1059-
writting out the current MasterNode (for example if the computer is turned
1059+
writing out the current MasterNode (for example if the computer is turned
10601060
off half way through the write)
10611061
"""
10621062

@@ -1133,7 +1133,7 @@ def position(self, config: CaptureFileConfiguration, /) -> int:
11331133
"""Return the absolute starting position of where to start writing the
11341134
current master node in the capture file.
11351135
1136-
There are two possible starting postitions for the two possible
1136+
There are two possible starting positions for the two possible
11371137
alternate master nodes.
11381138
11391139
A master node with an odd serial number is written at the first position

0 commit comments

Comments
 (0)