Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/wide template #783

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

barronh
Copy link

@barronh barronh commented Jan 6, 2022

The PR addresses issues raised in issue #723. Specifically, it adds the capability for a user to specify which template to use for a new Presentation. The key change was adding a keyword to the api and a new template for 16x9 ratio slides (aka wide). The wide.pptx is made using Powerpoint from Office16.

After the changes, I ran tox using py27 and py36 (not py38, but should have similar performance). All existing tests pass. I also did basic manual tests using pptx.Presentation.

  1. without specifying a template still makes the same file using the pptx/templates/default.pptx.
  2. specifying template='default' still makes the same file using the pptx/templates/default.pptx.
  3. specifying template='wide' now makes a 16x9 ratio format using the pptx/templates/wide.pptx.

I did not modify the tests/test_api.py because I am not familiar with the approach using those types of fixtures. Ideally, an additional test version using the alternate template would be added.

Presentation now has an optional keyword template with valid values of default and wide. Other options can be added later. Instead of checking for known options (default and wide), it checks for an existing path. If the path does not exist, the error informs the user that default and wide were options.
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.

None yet

1 participant