Avoid triggering the "style lookup by style_id is deprecated" warning ourselves.#140
Avoid triggering the "style lookup by style_id is deprecated" warning ourselves.#140stevecohen42 wants to merge 2 commits intopython-openxml:masterfrom
Conversation
|
Good catch Steve! :) Didn't think of that one and the tests of course completely miss that sort of thing. I'll get it merged in here and get a point release out. |
Legacy style ids were used in Document api methods for heading styles and default table style. Update tests, docstrings, and values to reflect style name instead of style id.
|
Fixed in release v0.8.1 on Feb 10, 2015. Thanks again for the catch Steve, I credited you the commit: b28b6cd :) |
|
Steve, there and was afraid you were not actively working on python-docx any updated for this change. You might just keep it in mind as you go about Cheers, Steve On Wed, Feb 11, 2015 at 3:09 AM, Steve Canny notifications@github.com
|
|
We get a bit of a backlog on pull requests. Most of them require a lot of additional work to meet the standards for being committed. In particular, most show up without tests. But they're still valuable to keep around. Sometimes another community member can use one as a holdover while waiting for a feature or as a starting point for their own efforts. And they often serve as a useful reference point when we work on the feature in earnest. I went back to the acceptance tests and worked my way forward on these changes, so I think we've got this change well covered. It's only in the API-level that we call the library from itself like that, to provide convenience functions, and I grepped the full project for those calls, so I feel like we've done our due diligence. If someone finds an outlier I'm sure we'll hear of it :) |
The API has changed to use style names rather than style IDs. This is a great step forward, but it now generates "style lookup by style_id is deprecated" warnings if headings (with a level number) or tables (without a style) are added to the document. This pull request fixes the automatic style name generation for headings and uses a valid style name for new tables.