Skip to content

Commit bd6cc8f

Browse files
committed
lint: complete linting in h2d.py
1 parent ee5c8be commit bd6cc8f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

htmldocx/h2d.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@
1212
1313
How to deal with block level style applied over table elements? e.g. text align
1414
"""
15+
import argparse
1516
import enum
16-
import re, argparse
17-
import io, os
17+
import io
18+
import os
19+
import re
1820
import urllib.request
19-
from urllib.parse import urlparse
2021
from html.parser import HTMLParser
22+
from urllib.parse import urlparse
2123

22-
import docx, docx.table
24+
import docx
25+
import docx.table
26+
from bs4 import BeautifulSoup
2327
from docx import Document
24-
from docx.shared import RGBColor, Pt, Inches
2528
from docx.enum.text import WD_COLOR, WD_ALIGN_PARAGRAPH
2629
from docx.oxml import OxmlElement
2730
from docx.oxml.ns import qn
2831
from docx.shared import Pt
29-
30-
from bs4 import BeautifulSoup
32+
from docx.shared import RGBColor, Inches
3133

3234
# values in inches
3335
INDENT = 0.25
@@ -311,7 +313,7 @@ def add_image_to_cell(self, cell, image, width, height):
311313
# python-docx doesn't have method yet for adding images to table cells. For now we use this
312314
paragraph = cell.add_paragraph()
313315
run = paragraph.add_run()
314-
run.add_picture(image,width,height)
316+
run.add_picture(image, width, height)
315317

316318
def handle_img(self, current_attrs):
317319
if not self.include_images:
@@ -335,9 +337,9 @@ def handle_img(self, current_attrs):
335337
if image:
336338
try:
337339
if isinstance(self.doc, docx.document.Document):
338-
self.doc.add_picture(image,width,height)
340+
self.doc.add_picture(image, width, height)
339341
else:
340-
self.add_image_to_cell(self.doc, image,width,height)
342+
self.add_image_to_cell(self.doc, image, width, height)
341343
except FileNotFoundError:
342344
image = None
343345
if not image:

0 commit comments

Comments
 (0)