rfctr: Blacken code base · python-openxml/python-docx@629f942 · GitHub
Skip to content

Commit 629f942

Browse files
committed
rfctr: Blacken code base
1 parent 36cac78 commit 629f942

157 files changed

Lines changed: 7141 additions & 6738 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 30 additions & 31 deletions

docx/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def _default_docx_path():
3434
Return the path to the built-in default .docx package.
3535
"""
3636
_thisdir = os.path.split(__file__)[0]
37-
return os.path.join(_thisdir, 'templates', 'default.docx')
37+
return os.path.join(_thisdir, "templates", "default.docx")

docx/blkcntnr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, element, parent):
2525
super(BlockItemContainer, self).__init__(parent)
2626
self._element = element
2727

28-
def add_paragraph(self, text='', style=None):
28+
def add_paragraph(self, text="", style=None):
2929
"""
3030
Return a paragraph newly added to the end of the content in this
3131
container, having *text* in a single run if present, and having
@@ -46,6 +46,7 @@ def add_table(self, rows, cols, width):
4646
distributed between the table columns.
4747
"""
4848
from .table import Table
49+
4950
tbl = CT_Tbl.new_tbl(rows, cols, width)
5051
self._element._insert_tbl(tbl)
5152
return Table(tbl, self)
@@ -65,6 +66,7 @@ def tables(self):
6566
Read-only.
6667
"""
6768
from .table import Table
69+
6870
return [Table(tbl, self) for tbl in self._element.tbl_lst]
6971

7072
def _add_paragraph(self):

docx/compat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# ===========================================================================
1414

1515
if sys.version_info >= (3, 0):
16-
1716
from collections.abc import Sequence
1817
from io import BytesIO
1918

@@ -28,7 +27,6 @@ def is_string(obj):
2827
# ===========================================================================
2928

3029
else:
31-
3230
from collections import Sequence # noqa
3331
from StringIO import StringIO as BytesIO # noqa
3432

docx/dml/color.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
DrawingML objects related to color, ColorFormat being the most prominent.
55
"""
66

7-
from __future__ import (
8-
absolute_import, division, print_function, unicode_literals
9-
)
7+
from __future__ import absolute_import, division, print_function, unicode_literals
108

119
from ..enum.dml import MSO_COLOR_TYPE
1210
from ..oxml.simpletypes import ST_HexColorAuto

docx/document.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Document(ElementProxy):
1818
a document.
1919
"""
2020

21-
__slots__ = ('_part', '__body')
21+
__slots__ = ("_part", "__body")
2222

2323
def __init__(self, element, part):
2424
super(Document, self).__init__(element)
@@ -44,7 +44,7 @@ def add_page_break(self):
4444
paragraph.add_run().add_break(WD_BREAK.PAGE)
4545
return paragraph
4646

47-
def add_paragraph(self, text='', style=None):
47+
def add_paragraph(self, text="", style=None):
4848
"""
4949
Return a paragraph newly added to the end of the document, populated
5050
with *text* and having paragraph style *style*. *text* can contain
@@ -172,9 +172,7 @@ def _block_width(self):
172172
space between the margins of the last section of this document.
173173
"""
174174
section = self.sections[-1]
175-
return Emu(
176-
section.page_width - section.left_margin - section.right_margin
177-
)
175+
return Emu(section.page_width - section.left_margin - section.right_margin)
178176

179177
@property
180178
def _body(self):
@@ -191,6 +189,7 @@ class _Body(BlockItemContainer):
191189
Proxy for ``<w:body>`` element in this document, having primarily a
192190
container role.
193191
"""
192+
194193
def __init__(self, body_elm, parent):
195194
super(_Body, self).__init__(body_elm, parent)
196195
self._body = body_elm

docx/enum/__init__.py

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)