Skip to content

Commit 8954d6e

Browse files
committed
Add # noqa to quiet linter
1 parent e30b568 commit 8954d6e

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

creating-and-modifying-pdfs/source_code/01-extracting-text-from-a-pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
# Putting It All Together
4242
# -----------------------
4343

44-
from pathlib import Path
45-
from PyPDF2 import PdfFileReader
44+
from pathlib import Path # noqa
45+
from PyPDF2 import PdfFileReader # noqa
4646

4747
# Change the path below to the correct path for your computer.
4848
pdf_path = (

creating-and-modifying-pdfs/source_code/02-extracting-pages-from-a-pdf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
print(type(page))
1212

13-
from pathlib import Path
13+
from pathlib import Path # noqa
1414

1515
with Path("blank.pdf").open(mode="wb") as output_file:
1616
pdf_writer.write(output_file)
@@ -20,8 +20,8 @@
2020
# Extracting a Single Page From a PDF
2121
# -----------------------------------
2222

23-
from pathlib import Path
24-
from PyPDF2 import PdfFileReader, PdfFileWriter
23+
from pathlib import Path # noqa
24+
from PyPDF2 import PdfFileReader, PdfFileWriter # noqa
2525

2626
# Change the path to work on your computer if necessary
2727
pdf_path = (
@@ -45,8 +45,8 @@
4545
# Extracting Multiple Pages From a PDF
4646
# ------------------------------------
4747

48-
from PyPDF2 import PdfFileReader, PdfFileWriter
49-
from pathlib import Path
48+
from PyPDF2 import PdfFileReader, PdfFileWriter # noqa
49+
from pathlib import Path # noqa
5050

5151
pdf_path = (
5252
Path.home()

creating-and-modifying-pdfs/source_code/03-concatenating-and-merging-pdfs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Concatenating PDFs With .append()
1111
# ---------------------------------
1212

13-
from pathlib import Path
13+
from pathlib import Path # noqa
1414

1515
reports_dir = (
1616
Path.home()
@@ -39,8 +39,8 @@
3939
# Merging PDFs With .merge()
4040
# --------------------------
4141

42-
from pathlib import Path
43-
from PyPDF2 import PdfFileMerger
42+
from pathlib import Path # noqa
43+
from PyPDF2 import PdfFileMerger # noqa
4444

4545
report_dir = (
4646
Path.home()

creating-and-modifying-pdfs/source_code/04-rotating-and-cropping-PDF-pages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
# Cropping Pages
5454
# --------------
5555

56-
from pathlib import Path
57-
from PyPDF2 import PdfFileReader, PdfFileWriter
56+
from pathlib import Path # noqa
57+
from PyPDF2 import PdfFileReader, PdfFileWriter # noqa
5858

5959
pdf_path = (
6060
Path.home()
@@ -88,7 +88,7 @@
8888

8989
first_page = pdf_reader.getPage(0)
9090

91-
import copy
91+
import copy # noqa
9292

9393
left_side = copy.deepcopy(first_page)
9494
current_coords = left_side.mediaBox.upperRight

creating-and-modifying-pdfs/source_code/05-encrypting-and-decrypting-pdfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
# Decrypting PDFs
3333
# ---------------
3434

35-
from pathlib import Path
36-
from PyPDF2 import PdfFileReader, PdfFileWriter
35+
from pathlib import Path # noqa
36+
from PyPDF2 import PdfFileReader, PdfFileWriter # noqa
3737

3838
pdf_path = Path.home() / "newsletter_protected.pdf"
3939

creating-and-modifying-pdfs/source_code/06-creating-a-pdf-file-from-scratch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# Setting the Page Size
1414
# ---------------------
1515

16-
from reportlab.lib.units import inch, cm
16+
from reportlab.lib.units import inch, cm # noqa
1717

1818
print(cm)
1919
print(inch)
2020

2121
canvas = Canvas("hello.pdf", pagesize=(8.5 * inch, 11 * inch))
2222

23-
from reportlab.lib.pagesizes import LETTER
23+
from reportlab.lib.pagesizes import LETTER # noqa
2424

2525
canvas = Canvas("hello.pdf", pagesize=LETTER)
2626
print(LETTER)
@@ -36,10 +36,10 @@
3636
canvas.save()
3737

3838
# The code below creates a PDF with blue text
39-
from reportlab.lib.colors import blue
40-
from reportlab.lib.pagesizes import LETTER
41-
from reportlab.lib.units import inch
42-
from reportlab.pdfgen.canvas import Canvas
39+
from reportlab.lib.colors import blue # noqa
40+
from reportlab.lib.pagesizes import LETTER # noqa
41+
from reportlab.lib.units import inch # noqa
42+
from reportlab.pdfgen.canvas import Canvas # noqa
4343

4444
canvas = Canvas("font-colors.pdf", pagesize=LETTER)
4545

0 commit comments

Comments
 (0)