Skip to content

Commit f113ff6

Browse files
committed
Merged upstream python-docx
2 parents 623ab28 + 36cac78 commit f113ff6

10 files changed

Lines changed: 315 additions & 70 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: python
22
python:
3+
- "3.8"
34
- "3.6"
4-
- "3.5"
55
- "2.7"
66
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
77
install: pip install -r requirements.txt

HISTORY.rst

Lines changed: 259 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,270 @@
11
.. :changelog:
22
3+
Release History
4+
---------------
35

4-
#Release History BayooG/bayoo-docx forked from (python-openxmm/python-docx)
6+
0.8.11 (2021-05-15)
7+
+++++++++++++++++++
58

9+
- Small build changes and Python 3.8 version changes like collections.abc location.
610

7-
0.2.8 (2020-05-02)
811

9-
- add comments implementation on a run level
10-
- fix issue with comments date (comments dates are set to current date)
12+
0.8.10 (2019-01-08)
13+
+++++++++++++++++++
1114

15+
- Revert use of expanded package directory for default.docx to work around setup.py
16+
problem with filenames containing square brackets.
1217

13-
0.2.4 (2019-9-4)
1418

15-
- loop over all the document chieldern (Paragraphs, Tables, Sections) with the right order `document.elements`
16-
- addons to Paragraph Object (delete, heading_level, merge_paragraph )
17-
- Add low-level implementation for comments part
18-
- Add oxml element for <w:comments> element and sub-elements
19-
- Add add_comment() method for docx.text.Paragraph
20-
- Add low-level implementation for footnotes part
21-
- Add oxml element for <w:footnotes> element and sub-elements
22-
- Add add_footnote() method for docx.text.Paragraph
19+
0.8.9 (2019-01-08)
20+
++++++++++++++++++
2321

22+
- Fix gap in MANIFEST.in that excluded default document template directory
2423

24+
25+
0.8.8 (2019-01-07)
26+
++++++++++++++++++
27+
28+
- Add support for headers and footers
29+
30+
31+
0.8.7 (2018-08-18)
32+
++++++++++++++++++
33+
34+
- Add _Row.height_rule
35+
- Add _Row.height
36+
- Add _Cell.vertical_alignment
37+
- Fix #455: increment next_id, don't fill gaps
38+
- Add #375: import docx failure on --OO optimization
39+
- Add #254: remove default zoom percentage
40+
- Add #266: miscellaneous documentation fixes
41+
- Add #175: refine MANIFEST.ini
42+
- Add #168: Unicode error on core-props in Python 2
43+
44+
45+
0.8.6 (2016-06-22)
46+
++++++++++++++++++
47+
48+
- Add #257: add Font.highlight_color
49+
- Add #261: add ParagraphFormat.tab_stops
50+
- Add #303: disallow XML entity expansion
51+
52+
53+
0.8.5 (2015-02-21)
54+
++++++++++++++++++
55+
56+
- Fix #149: KeyError on Document.add_table()
57+
- Fix #78: feature: add_table() sets cell widths
58+
- Add #106: feature: Table.direction (i.e. right-to-left)
59+
- Add #102: feature: add CT_Row.trPr
60+
61+
62+
0.8.4 (2015-02-20)
63+
++++++++++++++++++
64+
65+
- Fix #151: tests won't run on PyPI distribution
66+
- Fix #124: default to inches on no TIFF resolution unit
67+
68+
69+
0.8.3 (2015-02-19)
70+
++++++++++++++++++
71+
72+
- Add #121, #135, #139: feature: Font.color
73+
74+
75+
0.8.2 (2015-02-16)
76+
++++++++++++++++++
77+
78+
- Fix #94: picture prints at wrong size when scaled
79+
- Extract `docx.document.Document` object from `DocumentPart`
80+
81+
Refactor `docx.Document` from an object into a factory function for new
82+
`docx.document.Document object`. Extract methods from prior `docx.Document`
83+
and `docx.parts.document.DocumentPart` to form the new API class and retire
84+
`docx.Document` class.
85+
86+
- Migrate `Document.numbering_part` to `DocumentPart.numbering_part`. The
87+
`numbering_part` property is not part of the published API and is an
88+
interim internal feature to be replaced in a future release, perhaps with
89+
something like `Document.numbering_definitions`. In the meantime, it can
90+
now be accessed using ``Document.part.numbering_part``.
91+
92+
93+
0.8.1 (2015-02-10)
94+
++++++++++++++++++
95+
96+
- Fix #140: Warning triggered on Document.add_heading/table()
97+
98+
99+
0.8.0 (2015-02-08)
100+
++++++++++++++++++
101+
102+
- Add styles. Provides general capability to access and manipulate paragraph,
103+
character, and table styles.
104+
105+
- Add ParagraphFormat object, accessible on Paragraph.paragraph_format, and
106+
providing the following paragraph formatting properties:
107+
108+
+ paragraph alignment (justfification)
109+
+ space before and after paragraph
110+
+ line spacing
111+
+ indentation
112+
+ keep together, keep with next, page break before, and widow control
113+
114+
- Add Font object, accessible on Run.font, providing character-level
115+
formatting including:
116+
117+
+ typeface (e.g. 'Arial')
118+
+ point size
119+
+ underline
120+
+ italic
121+
+ bold
122+
+ superscript and subscript
123+
124+
The following issues were retired:
125+
126+
- Add feature #56: superscript/subscript
127+
- Add feature #67: lookup style by UI name
128+
- Add feature #98: Paragraph indentation
129+
- Add feature #120: Document.styles
130+
131+
**Backward incompatibilities**
132+
133+
Paragraph.style now returns a Style object. Previously it returned the style
134+
name as a string. The name can now be retrieved using the Style.name
135+
property, for example, `paragraph.style.name`.
136+
137+
138+
0.7.6 (2014-12-14)
139+
++++++++++++++++++
140+
141+
- Add feature #69: Table.alignment
142+
- Add feature #29: Document.core_properties
143+
144+
145+
0.7.5 (2014-11-29)
146+
++++++++++++++++++
147+
148+
- Add feature #65: _Cell.merge()
149+
150+
151+
0.7.4 (2014-07-18)
152+
++++++++++++++++++
153+
154+
- Add feature #45: _Cell.add_table()
155+
- Add feature #76: _Cell.add_paragraph()
156+
- Add _Cell.tables property (read-only)
157+
158+
159+
0.7.3 (2014-07-14)
160+
++++++++++++++++++
161+
162+
- Add Table.autofit
163+
- Add feature #46: _Cell.width
164+
165+
166+
0.7.2 (2014-07-13)
167+
++++++++++++++++++
168+
169+
- Fix: Word does not interpret <w:cr/> as line feed
170+
171+
172+
0.7.1 (2014-07-11)
173+
++++++++++++++++++
174+
175+
- Add feature #14: Run.add_picture()
176+
177+
178+
0.7.0 (2014-06-27)
179+
++++++++++++++++++
180+
181+
- Add feature #68: Paragraph.insert_paragraph_before()
182+
- Add feature #51: Paragraph.alignment (read/write)
183+
- Add feature #61: Paragraph.text setter
184+
- Add feature #58: Run.add_tab()
185+
- Add feature #70: Run.clear()
186+
- Add feature #60: Run.text setter
187+
- Add feature #39: Run.text and Paragraph.text interpret '\n' and '\t' chars
188+
189+
190+
0.6.0 (2014-06-22)
191+
++++++++++++++++++
192+
193+
- Add feature #15: section page size
194+
- Add feature #66: add section
195+
- Add page margins and page orientation properties on Section
196+
- Major refactoring of oxml layer
197+
198+
199+
0.5.3 (2014-05-10)
200+
++++++++++++++++++
201+
202+
- Add feature #19: Run.underline property
203+
204+
205+
0.5.2 (2014-05-06)
206+
++++++++++++++++++
207+
208+
- Add feature #17: character style
209+
210+
211+
0.5.1 (2014-04-02)
212+
++++++++++++++++++
213+
214+
- Fix issue #23, `Document.add_picture()` raises ValueError when document
215+
contains VML drawing.
216+
217+
218+
0.5.0 (2014-03-02)
219+
++++++++++++++++++
220+
221+
- Add 20 tri-state properties on Run, including all-caps, double-strike,
222+
hidden, shadow, small-caps, and 15 others.
223+
224+
225+
0.4.0 (2014-03-01)
226+
++++++++++++++++++
227+
228+
- Advance from alpha to beta status.
229+
- Add pure-python image header parsing; drop Pillow dependency
230+
231+
232+
0.3.0a5 (2014-01-10)
233+
++++++++++++++++++++++
234+
235+
- Hotfix: issue #4, Document.add_picture() fails on second and subsequent
236+
images.
237+
238+
239+
0.3.0a4 (2014-01-07)
240+
++++++++++++++++++++++
241+
242+
- Complete Python 3 support, tested on Python 3.3
243+
244+
245+
0.3.0a3 (2014-01-06)
246+
++++++++++++++++++++++
247+
248+
- Fix setup.py error on some Windows installs
249+
250+
251+
0.3.0a1 (2014-01-05)
252+
++++++++++++++++++++++
253+
254+
- Full object-oriented rewrite
255+
- Feature-parity with prior version
256+
- text: add paragraph, run, text, bold, italic
257+
- table: add table, add row, add column
258+
- styles: specify style for paragraph, table
259+
- picture: add inline picture, auto-scaling
260+
- breaks: add page break
261+
- tests: full pytest and behave-based 2-layer test suite
262+
263+
264+
0.3.0dev1 (2013-12-14)
265+
++++++++++++++++++++++
266+
267+
- Round-trip .docx file, preserving all parts and relationships
268+
- Load default "template" .docx on open with no filename
269+
- Open from stream and save to stream (file-like object)
270+
- Add paragraph at and of document

docs/api/enum/WdLineSpacing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Example::
1010
from docx.enum.text import WD_LINE_SPACING
1111

1212
paragraph = document.add_paragraph()
13-
paragraph.line_spacing_rule = WD_LINE_SPACING.EXACTLY
13+
paragraph.paragraph_format.line_spacing_rule = WD_LINE_SPACING.EXACTLY
1414

1515
----
1616

docs/api/style.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Style-related objects
66

77
A style is used to collect a set of formatting properties under a single name
88
and apply those properties to a content object all at once. This promotes
9-
formatting consistency thoroughout a document and across related documents
9+
formatting consistency throughout a document and across related documents
1010
and allows formatting changes to be made globally by changing the definition
1111
in the appropriate style.
1212

docs/dev/analysis/features/shapes/picture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Candidate protocol
1212
::
1313

1414
>>> run = paragraph.add_run()
15-
>>> inline_shape = run.add_inline_picture(file_like_image, MIME_type=None)
15+
>>> inline_shape = run.add_picture(file_like_image, MIME_type=None)
1616
>>> inline_shape.width = width
1717
>>> inline_shape.height = height
1818

docx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from docx.api import Document # noqa
44

5-
__version__ = '0.2.14'
5+
__version__ = "0.8.11"
66

77

88
# register custom Part classes with opc package reader

docx/compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ def is_string(obj):
3434

3535
def is_string(obj):
3636
"""Return True if *obj* is a string, False otherwise."""
37-
return isinstance(obj, basestring)
37+
return isinstance(obj, basestring) # noqa
3838

39-
Unicode = unicode
39+
Unicode = unicode # noqa

docx/opc/compat.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
Provides Python 2/3 compatibility objects
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
import sys
1210

@@ -29,6 +27,7 @@ def is_string(obj):
2927
"""
3028
return isinstance(obj, str)
3129

30+
3231
# ===========================================================================
3332
# Python 2 versions
3433
# ===========================================================================
@@ -47,4 +46,4 @@ def is_string(obj):
4746
"""
4847
Return True if *obj* is a string, False otherwise.
4948
"""
50-
return isinstance(obj, basestring)
49+
return isinstance(obj, basestring) # noqa

0 commit comments

Comments
 (0)