Skip to content

Pull updates from master repo#4

Open
taras-panasiuk-dev wants to merge 126 commits intoquintagroup:masterfrom
python-openxml:master
Open

Pull updates from master repo#4
taras-panasiuk-dev wants to merge 126 commits intoquintagroup:masterfrom
python-openxml:master

Conversation

@taras-panasiuk-dev
Copy link

No description provided.

scanny and others added 30 commits September 24, 2023 12:18
This improves packaging reliability because it prevents tests from
running against the current directory instead of the installed version
of the package.
This required a large number of adjustments. I took the opportunity to
make some further clean-up of top-matter.
Also any Python 2 clean-up that was handy.
* encoding header is no longer needed
* from __future__ imports no longer needed
* make module docstrings PEP 257 compliant.
Sphinx handling is actually better, not only using italic but also a
mono-width font.
Done by `docformatter`, it can't get the summary line right if it's too
long, but adjusts the description block width and gets the shorter
docstrings right, so a lot better than doing them all by hand. The rest
will have to wait for hand curation as we go.
Back in the day I thought it better to extract a test-specific fixture
for each test. That had the benefit of making parameterized tests fold
cleanly without the parameters in the decorator. The downside was you
had to look in two places to understand the test so I dropped that
practice. Fix some of these I need to change or add to later.
The old @lazyproperty implementation worked, but was much messier than
the modern version, adding a member to the object __dict__. This later
version that stores the value in the descriptor is much more tidy and
more performant too I expect.
Also for example `BaseStoryPart` -> `StoryPart` for the same reason.
This removes some import cycles.
Metaclasses are different and somewhat better in Python 3. Modernize the
`xmlchemy` custom element metaclass mechanism and remove Python 2
work-arounds that are no longer required.
Add additional run inner-content elements having a text equivalent, in
particular `w:noBreakHyphen` and `w:ptab`. Give each of them their own
custom element class having a `__str__()` method so they can each report
their text content (constant in some cases like "-" for no-break
hyphen).
scanny added 30 commits June 12, 2025 15:37
- inline single-test fixtures
- remove obsolete pre-cxml XML builders
Run `ruff format` on code base.
The removed `._insert_pic(pic)` call is redundant because the `pic`
element is already inserted by the prior `CT_Inline.new()` call. The
reason the second `._insert_pic()` call did not add a second `pic`
element is that the `pic` element is the same instance in both cases. So
that `pic` element is "moved" from where it was, back to the same place.
Provides access to the comments collection from the document object.
Provide a way to get a `Comments` object from the `DocumentPart`.
Also involves adding `CommentsPart.default`. Because the comments part
is optional, we need a mechanism to add a default (empty) comments part
when one is not present. This is what `CommentsPart.default()` is for.
CommentsPart is loaded as XML-part on document deserialization.
To get a comment by id, None when not found.
Actual implementation is primarily inherited from `BlockItemContainer`,
but support for those operations must be present in `CT_Comment` and
it's worth testing explicitly.
Only with `text` parameter so far. Author and initials parameters to
follow.
- allow setting on construction
- allow update with property setters
- developer/analysis docs
- user docs
- API docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants