Commit a3a4593
Python openxml master (#11)
* pep8: fixes for latest version of flake8
* Also take care of a pesky warning from pytest when getting style by
id.
* test: upgrade mock helpers to autospec by default
* docs: update header/footer analysis
* docs: add user docs for header/footer
* build: remove 2.6 testing on travis
Python 2.6 seems to be no longer supported on travis.ci so we're letting
it drop here. We're retaining testing on 2.6 in tox for now though.
* rfctr: blacken selected items
In preparation for moving to Python Black for standardized code layout,
get the custom element mappings closer to Black style layout.
* rfctr: modernize formatting
* acpt: add scenarios for headers and footers
* rfctr: Sections gets document_part
To access header and footer parts, Section will need the document part
and the source for that will be its Sections parent proxy. Add
document_part as construction parameter for Sections and modify tests to
suit.
* rfctr: Section gets document_part
* Modernize section unit test fixtures while in there.
* sect: add Section.footer
* sect: add Section.header
* hdr: add _Header.is_linked_to_previous
* hdr: add _Header._has_header_part
* hdr: add _Header.is_linked_to_previous setter
* hdr: add _Header._drop_header_part()
* hdr: add DocumentPart.drop_header_part()
* hdr: add _Header._add_header_part()
* hdr: add DocumentPart.add_header_part()
* hdr: add HeaderPart.new()
* pkg: add OpcPackage.next_partname()
* hdr: add HeaderPart._default_header_xml()
* hdr: add _Header._element
* hdr: add _Header._get_or_add_header_part()
* hdr: add _Header._prior_header
* hdr: add _Header._header_part
* hdr: add DocumentPart.header_part()
* hdr: add PartFactory loads HeaderPart
* hdr: extract _BaseHeaderFooter
Extract _BaseHeaderFooter as a common base class for _Header and _Footer
to which common behaviors can be abstracted.
* hdr: add _BaseHeaderFooter.is_linked_to_p.. getter
* hdr: add _Footer._has_definition
* hdr: add _BaseHeaderFooter.is_linked_to_p.. setter
* hdr: extract _Header.is_linked_to_previous
_Header can now rely on _BaseHeaderFooter for this behavior.
* hdr: add _Footer._drop_definition()
* hdr: add _Footer._add_definition()
* hdr: add DocumentPart.add_footer_part()
* hdr: add FooterPart.new()
* hdr: add FooterPart._default_footer_xml()
* hdr: add _BaseHeaderFooter._element
* hdr: add _BaseHeaderFooter._get_or_add_definition()
* hdr: add _Footer._prior_headerfooter
* hdr: add _Footer._definition
* hdr: add DocumentPart.footer_part()
* hdr: add PartFactory loads FooterPart
* acpt: add header /footer content insert scenarios
* hdr: add _BaseHeaderFooter.part
* hdr: add BaseStoryPart.get_style_id()
* hdr: add BaseStoryPart._document_part
* hdr: add BaseStoryPart.get_style()
* hdr: add BaseStoryPart.new_pic_inline()
This is essentially migrated "up" from DocumentPart, which now
subclasses BaseStoryPart.
* hdr: add BaseStoryPart.get_or_add_image()
Also extract Package.get_or_add_image_part() to avoid BaseStoryPart and
others having to know about ImageParts.
* hdr: add BaseStoryPart.next_id
* acpt: add odd-even-page-headers scenarios
* hdr: add Settings.odd_and_even_pages_header_footer
Getter side.
* hdr: add Settings.odd_and_even_pages_head.. setter
Add some namespace-prefix mappings that arise for the first time in
headers.
* acpt: add scenarios for Section.diff_first_page..
Add scenarios for Section.different_first_page_header_footer.
* hdr: add Section.different_first_page_header_footr
* hdr: add Section.different_first_page_hea.. setter
* acpt: add scenarios for first/even header/footer
* rfctr: _Header and _Footer take header/footer type
In preparation for adding even-page and first-page header and footer
properties, pass the WD_HEADER_FOOTER_INDEX member identifying the
header or footer type (primary, first, even) to _Header and _Footer on
construction. This will allow each of these classes to serve for all
three header/footer types.
* hdr: add Section.even_page_footer
* hdr: add Section.even_page_header
* hdr: add Section.first_page_footer
* hdr: add Section.first_page_header
* docs: add API docs for header/footer
* doc: Document.add_section() strips hdr/ftr refs
The implementation of `Document.add_section()` "clones" the previously
last `w:sectPr` element to produce the `w:sectPr` for the new section.
This has the effect of duplicating the header and footer references
along with the rIds used to link them to their header or footer part.
There have been no reports that this causes a problem, but in any case
the correct behavior is to add a new section without any header or
footer definitions, such that the new section "inherits" all
header/footer definitions (and header/footer parts are not "reused").
Add code to remove all `w:headerReference` and `w:footerReference`
elements from a "cloned" `w:sectPr` element when adding a section.
* rfctr: extract default .docx template to directory
Maintaining the default document template as a directory allows its
individual parts (XML files) to be curated like code, with line-changes
tracked by Git.
Extract the default template to a directory and load that directory as
the default when no template document is specified to the `Document()`
constructor.
Also add Header and Footer styles.
* release: prepare v0.8.8 release
* release: prepare v0.8.9 release
* release: prepare v0.8.10 release
* fix: tweak setup.py handling of template directory
Also some pending documentation updates and some Black changes.
* fix: miscellaneous small Python 3 build-time fixes
* Add 'zip_safe' == False to setup.py
* fix: documentation fixes
* black: blacken setup.py
This produces a lot of line changes for single to double quotes, but no
logic changes were made.
* release: prepare v0.8.11 release
Co-authored-by: Steve Canny <stcanny@gmail.com>
Co-authored-by: eupharis <dan@highwaterlabs.com>
Co-authored-by: Ondrej Zoričák <1ondrej.zoricak@gmail.com>
Co-authored-by: Brian Seitz <brnstz@gmail.com>1 parent 40f5aef commit a3a4593
103 files changed
Lines changed: 28029 additions & 1398 deletions
File tree
- docs
- _static/img
- api
- enum
- dev/analysis/features
- shapes
- user
- docx
- enum
- image
- opc
- oxml
- parts
- styles
- templates
- default-docx-template
- _rels
- customXml
- _rels
- docProps
- word
- _rels
- theme
- features
- steps
- test_files
- tests
- image
- opc
- oxml
- parts
- styles
- text
- unitutil
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
6 | 31 | | |
7 | 32 | | |
8 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
| |||
0 commit comments