Upgrade to Python 3.8 (from 2.7)#4
Merged
davidverweij merged 8 commits intodavidverweij:masterfrom May 3, 2020
jawrainey:move_to_p3
Merged
Upgrade to Python 3.8 (from 2.7)#4davidverweij merged 8 commits intodavidverweij:masterfrom jawrainey:move_to_p3
davidverweij merged 8 commits intodavidverweij:masterfrom
jawrainey:move_to_p3
Conversation
- Removed all error handling issues as they will be resolved when the codebase is moved to click (CLI); - Made use of Python's f strings; - Added several notes of where/why I made changes (please remove on PR); - Used set difference instead of for loop for simplicity;
Used csvdict.fieldnames rather than next on csv reader to prevent reopening the file again.
A new MailMerge must be created for each new file
- Note: `example_template.docx` was re-added as it was (accidently?) removed from master
Owner
|
I had some issues with my pyenv setup (was incomplete) - but the PR seemed to work nicely. Will create another issue to check on the python 2.7 dependency we started with for docx-mergefields. |
davidverweij
added a commit
that referenced
this pull request
May 6, 2020
Based on online found templates and @jawrainey use in #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed?
Upgraded the default python support to
3.8.0to leverage modern features (see here)Made minor tweaks to the script by moving all code to a separate method (
convert) in the CLI.Merged your CLI changes into this PR (i.e. now use click) and proposed alternative parameter naming (see here) and position of arguments. My thoughts is that the script takes data to apply to a user-defined template.
Verifying Changes
poetry installpoetry shellto activate python 3.8.0python docx-csv-mailmerge.py example_data.csv example_template.docx ";"from the root folder;->* This is where some unit testing, git hooks, and CI can come into play in the future 🥇