Skip to content

Commit a195cb3

Browse files
authored
STY: Consistency of spaces after period (#2717)
Remove two spaces after a period so everywhere one space is used.
1 parent 988714f commit a195cb3

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@
9393

9494
# -- Options for HTML output -------------------------------------------------
9595

96-
# The theme to use for HTML and HTML Help pages. See the documentation for
96+
# The theme to use for HTML and HTML Help pages. See the documentation for
9797
# a list of builtin themes.
9898
#
9999
html_theme = "sphinx_rtd_theme"
100100

101101
# Theme options are theme-specific and customize the look and feel of a theme
102-
# further. For a list of options available for each theme, see the
102+
# further. For a list of options available for each theme, see the
103103
# documentation.
104104
html_theme_options = {
105105
"canonical_url": "",

pypdf/_reader.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def get_object(
514514
def read_object_header(self, stream: StreamType) -> Tuple[int, int]:
515515
# Should never be necessary to read out whitespace, since the
516516
# cross-reference table should put us in the right spot to read the
517-
# object header. In reality... some files have stupid cross reference
517+
# object header. In reality some files have stupid cross reference
518518
# tables that are off by whitespace bytes.
519519
extra = False
520520
skip_over_comment(stream)
@@ -736,8 +736,8 @@ def _read_standard_xref_table(self, stream: StreamType) -> None:
736736

737737
# On the other hand, some malformed PDF files
738738
# use a single character EOL without a preceding
739-
# space. Detect that case, and seek the stream
740-
# back one character. (0-9 means we've bled into
739+
# space. Detect that case, and seek the stream
740+
# back one character (0-9 means we've bled into
741741
# the next xref entry, t means we've bled into the
742742
# text "trailer"):
743743
if line[-1] in b"0123456789t":
@@ -896,7 +896,7 @@ def _read_xref_other_error(
896896
__name__,
897897
)
898898
return None
899-
# bad xref character at startxref. Let's see if we can find
899+
# bad xref character at startxref. Let's see if we can find
900900
# the xref table nearby, as we've observed this error with an
901901
# off-by-one before.
902902
stream.seek(-11, 1)
@@ -1063,7 +1063,7 @@ def decrypt(self, password: Union[str, bytes]) -> PasswordType:
10631063
owner password, and then stores the resulting decryption key if either
10641064
password is correct.
10651065
1066-
It does not matter which password was matched. Both passwords provide
1066+
It does not matter which password was matched. Both passwords provide
10671067
the correct decryption key that will allow the document to be used with
10681068
this library.
10691069

pypdf/_writer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ def append_pages_from_reader(
749749
750750
Args:
751751
reader: a PdfReader object from which to copy page
752-
annotations to this writer object. The writer's annots
752+
annotations to this writer object. The writer's annots
753753
will then be updated.
754754
after_page_append:
755755
Callback function that is invoked after each page is appended to
@@ -1186,10 +1186,10 @@ def encrypt(
11861186
user_password: The password which allows for opening
11871187
and reading the PDF file with the restrictions provided.
11881188
owner_password: The password which allows for
1189-
opening the PDF files without any restrictions. By default,
1189+
opening the PDF files without any restrictions. By default,
11901190
the owner password is the same as the user password.
11911191
use_128bit: flag as to whether to use 128bit
1192-
encryption. When false, 40bit encryption will be used.
1192+
encryption. When false, 40bit encryption will be used.
11931193
By default, this flag is on.
11941194
permissions_flag: permissions as described in
11951195
Table 3.20 of the PDF 1.7 specification. A bit value of 1 means
@@ -1413,7 +1413,7 @@ def _sweep_indirect_references(
14131413
# an array update the value
14141414
if isinstance(parent, (DictionaryObject, ArrayObject)):
14151415
if isinstance(data, StreamObject):
1416-
# a dictionary value is a stream. streams must be indirect
1416+
# a dictionary value is a stream; streams must be indirect
14171417
# objects, so we need to change this value.
14181418
data = self._resolve_indirect_object(self._add_object(data))
14191419

pypdf/generic/_base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ def original_bytes(self) -> bytes:
557557

558558
def get_original_bytes(self) -> bytes:
559559
# We're a text string object, but the library is trying to get our raw
560-
# bytes. This can happen if we auto-detected this string as text, but
561-
# we were wrong. It's pretty common. Return the original bytes that
560+
# bytes. This can happen if we auto-detected this string as text, but
561+
# we were wrong. It's pretty common. Return the original bytes that
562562
# would have been used to create this object, based upon the autodetect
563563
# method.
564564
if self.autodetect_utf16:
@@ -574,8 +574,8 @@ def get_original_bytes(self) -> bytes:
574574
raise Exception("no information about original bytes") # pragma: no cover
575575

576576
def get_encoded_bytes(self) -> bytes:
577-
# Try to write the string out as a PDFDocEncoding encoded string. It's
578-
# nicer to look at in the PDF file. Sadly, we take a performance hit
577+
# Try to write the string out as a PDFDocEncoding encoded string. It's
578+
# nicer to look at in the PDF file. Sadly, we take a performance hit
579579
# here for trying...
580580
try:
581581
if self.autodetect_utf16:

pypdf/generic/_data_structures.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def xmp_metadata(self) -> Optional[XmpInformationProtocol]:
426426
427427
Returns:
428428
Returns a :class:`~pypdf.xmp.XmpInformation` instance
429-
that can be used to access XMP metadata from the document. Can also
429+
that can be used to access XMP metadata from the document. Can also
430430
return None if no metadata was found on the document root.
431431
"""
432432
from ..xmp import XmpInformation
@@ -1158,10 +1158,10 @@ def _parse_content_stream(self, stream: StreamType) -> None:
11581158
operands = []
11591159
elif peek == b"%":
11601160
# If we encounter a comment in the content stream, we have to
1161-
# handle it here. Typically, read_object will handle
1161+
# handle it here. Typically, read_object will handle
11621162
# encountering a comment -- but read_object assumes that
11631163
# following the comment must be the object we're trying to
1164-
# read. In this case, it could be an operator instead.
1164+
# read. In this case, it could be an operator instead.
11651165
while peek not in (b"\r", b"\n", b""):
11661166
peek = stream.read(1)
11671167
else:

pypdf/generic/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def read_string_from_stream(
9595
tok = b_(chr(int(tok, base=8)))
9696
elif tok in b"\n\r":
9797
# This case is hit when a backslash followed by a line
98-
# break occurs. If it's a multi-char EOL, consume the
98+
# break occurs. If it's a multi-char EOL, consume the
9999
# second character:
100100
tok = stream.read(1)
101101
if tok not in b"\n\r":

pypdf/xmp.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
# documented meaning.
3939
#
4040
# Elements in the namespace are key/value-style storage,
41-
# where the element name is the key and the content is the value. The keys
41+
# where the element name is the key and the content is the value. The keys
4242
# are transformed into valid XML identifiers by substituting an invalid
4343
# identifier character with \u2182 followed by the unicode hex ID of the
44-
# original character. A key like "my car" is therefore "my\u21820020car".
44+
# original character. A key like "my car" is therefore "my\u21820020car".
4545
#
4646
# \u2182 is the unicode character \u{ROMAN NUMERAL TEN THOUSAND}
4747
#
48-
# The pdfx namespace should be avoided. A
49-
# custom data schema and sensical XML elements could be used instead, as is
48+
# The pdfx namespace should be avoided.
49+
# A custom data schema and sensical XML elements could be used instead, as is
5050
# suggested by Adobe's own documentation on XMP under "Extensibility of
5151
# Schemas".
5252
PDFX_NAMESPACE = "http://ns.adobe.com/pdfx/1.3/"

0 commit comments

Comments
 (0)