Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
bc36887
Add Python project files to the gitignore
ApolloFops May 17, 2024
1bc2324
Add an editorconfig file
ApolloFops May 17, 2024
d510381
Change the sample E-mail addresses to use example.com domains
ApolloFops May 17, 2024
b909126
Restructure the project and upload drafts directly to Gmail
ApolloFops May 17, 2024
3c577f3
Merge branch 'fodfodfod:main' into main
ApolloFops May 17, 2024
19343e3
Update gitignore
ApolloFops May 17, 2024
56dbfd5
Restructure the project according to the PyPA guidelines
ApolloFops May 17, 2024
7dd9c55
Rename module to resolve naming conflict
ApolloFops May 18, 2024
cee9263
Fix indentation
ApolloFops May 18, 2024
ea75390
Pull the template from a JSON file
ApolloFops May 18, 2024
3a52669
Add a Github action to publish package on release
ApolloFops May 18, 2024
bb65170
Create a GitHub action to build on push and release on tag
ApolloFops May 18, 2024
72016cf
Combine the GitHub Actions workflows into one workflow
ApolloFops May 18, 2024
63d459f
Split the GitHub Actions workflow into seperate jobs
ApolloFops May 18, 2024
9384bf1
Add command line arguments for various things
ApolloFops May 18, 2024
16c7602
Add a more guided credential setup process
ApolloFops May 18, 2024
0bfb928
New version
ApolloFops May 18, 2024
6a9a3fe
Remove artifact names from the GitHub Actions workflow's download tasks
ApolloFops May 18, 2024
8ac39db
Update deprecated Github Actions actions
ApolloFops May 18, 2024
9ec5b9b
Split the file parser into modules
ApolloFops May 18, 2024
9f26d91
Add a CSV parser
ApolloFops May 18, 2024
55b07d5
Update README
ApolloFops May 18, 2024
79ef044
Seperate authentication logic from TUI and move credentials to a glob…
ApolloFops May 18, 2024
c94a008
Update editorconfig
ApolloFops May 18, 2024
f784cae
Use a Trusted Publisher instead of a token for releasing to PyPI
ApolloFops May 18, 2024
64a73ba
Move the sample template to a function
ApolloFops May 19, 2024
95a6fd1
Make more things classes
ApolloFops May 19, 2024
22d26c3
Change Python version requirement
ApolloFops May 20, 2024
38eee69
Change the run script to use a temporary file so the credentials setu…
ApolloFops May 20, 2024
959e116
Change the setup script to install system site packages
ApolloFops May 20, 2024
b47d378
Remove warning that isn't true
ApolloFops May 23, 2024
ff1fdca
Add yapf style
ApolloFops Jun 29, 2024
4b628e8
Enable vscode format on save
ApolloFops Jun 29, 2024
03460b4
Add comparison and json serialization to attachments and email templates
ApolloFops Jun 29, 2024
d5b9467
Add a validity check for email addresses
ApolloFops Jun 29, 2024
e612dc0
Split email draft generation into its own class
ApolloFops Jun 29, 2024
d326e83
Add an initial gui version
ApolloFops Jun 29, 2024
d164eda
Add a template editor
ApolloFops Jun 29, 2024
d225750
Initial GUI editor for EmailAttachments
ApolloFops Jun 29, 2024
172526c
Make the type checker less angry
ApolloFops Jun 29, 2024
9b5eb57
Add some more stuff to the attachment editor
ApolloFops Jun 29, 2024
467f6ff
Add a delete button to the attachment editor
ApolloFops Jun 29, 2024
4119fdf
Handle incorrect filetypes a bit better in the parser
ApolloFops Jun 29, 2024
01d3850
Fix JSON serialization of attachment paths
ApolloFops Jun 29, 2024
8af34ea
Add a New Attachment button
ApolloFops Jun 29, 2024
1fb2c30
Add a shebang to `run_gui.py`
ApolloFops Aug 24, 2024
b35dfb2
Add initial functionality for importing E-mail lists
ApolloFops Aug 24, 2024
bd04952
Add an install script
ApolloFops Aug 24, 2024
f7577ae
Make `generate_drafts()` a class method
ApolloFops Aug 25, 2024
d0905e7
Use EmailRecipients instead of dicts in `generate_drafts()`
ApolloFops Aug 25, 2024
73f658a
Fix some UI layout problems
ApolloFops Aug 25, 2024
8401012
Add a progress bar
ApolloFops Aug 25, 2024
28ce4ab
Fix prompt to open E-mail list
ApolloFops Aug 25, 2024
7395827
Add a title to the E-mail list file selector window
ApolloFops Aug 25, 2024
d2cebe1
Add filetypes to the E-mail list file selector
ApolloFops Aug 25, 2024
d7577c4
Add a title and filetypes to the E-mail template file selector
ApolloFops Aug 25, 2024
156df42
Add title and filetype to API credential file selector
ApolloFops Aug 25, 2024
73f44e5
Prompt the user to save the template to a file if no file exists already
ApolloFops Aug 25, 2024
f21c957
Clear the attachment list when opening a template
ApolloFops Aug 25, 2024
d7024e6
Reset template if user opts to not save changes
ApolloFops Aug 25, 2024
02ac3bf
Add a save as button to the template editor
ApolloFops Aug 25, 2024
1e1fb9a
Add checks to make sure that the user selected a file
ApolloFops Aug 25, 2024
598f9c3
Add a log out function
ApolloFops Aug 26, 2024
6849f27
Show whether an account is logged in or not
ApolloFops Aug 26, 2024
855841e
Refocus main window when the authentication flow is complete
ApolloFops Aug 26, 2024
6a8ae24
Adjust the UI spacing so things look a bit nicer
ApolloFops Aug 26, 2024
538f60a
Add a save as button to the standalone template editor
ApolloFops Aug 26, 2024
16f3751
Update readme to include GUI instructions
ApolloFops Aug 26, 2024
4cb85c6
Update `pyproject.toml` since this has mostly split off from upstream
ApolloFops Aug 26, 2024
e891602
Update development status to Beta
ApolloFops Aug 26, 2024
e99ed93
Add a script to package with PyInstaller
ApolloFops Aug 26, 2024
128ea8d
Add noconfirm flag to PyInstaller command
ApolloFops Aug 26, 2024
7b27988
Add PyInstaller as an optional dependency
ApolloFops Aug 26, 2024
b10baa7
Build PyInstaller packages with CI
ApolloFops Aug 26, 2024
5169730
Add a run file that PyInstaller can point to
ApolloFops Aug 26, 2024
8206063
Merge branch 'gui'
ApolloFops Aug 26, 2024
d1c41b8
Create an icon
ApolloFops Aug 27, 2024
a2ec45f
Include the icon in the package
ApolloFops Aug 27, 2024
e52a546
Move the icon to the assets directory
ApolloFops Aug 27, 2024
2a55621
Add a way to save errored E-mail recipients to a file
ApolloFops Aug 27, 2024
df04e41
Fix the error output functionality
ApolloFops Aug 27, 2024
72c0d9b
Move a parameter to a class
ApolloFops Aug 27, 2024
fca0d24
Update the UI layout
ApolloFops Aug 27, 2024
a961a62
Update the icon to be a bit closer to the MacOS icon style
ApolloFops Aug 27, 2024
a2e93de
Update the icon
ApolloFops Aug 27, 2024
a45985f
Add styling to the error button
ApolloFops Aug 27, 2024
bf0c0c3
Use `__main__.py` instead of `run.py` for the pyinstaller target
ApolloFops Aug 27, 2024
919ed7e
Fix a bug where the program spawns multiple instances of itself
ApolloFops Aug 27, 2024
37f799f
Fix Windows builds
ApolloFops Aug 27, 2024
290d8f0
Use a specfile for pyinstaller
ApolloFops Aug 27, 2024
0ebbefc
Add a version to the MacOS package metadata
ApolloFops Aug 27, 2024
c410e9e
Wrap MacOS build in a DMG
ApolloFops Aug 27, 2024
806d513
Combine pyinstaller jobs
ApolloFops Aug 27, 2024
5225978
Clean up the MacOS build artifacts
ApolloFops Aug 27, 2024
8889ef7
Update icon
ApolloFops Aug 27, 2024
b379071
Add error messages while importing templates
ApolloFops Aug 28, 2024
3e6df8f
Remove error button styling
ApolloFops Aug 28, 2024
d17b00d
Create a different style of icon for Windows and Linux targets
ApolloFops Aug 28, 2024
b6320f3
Add pyinstaller builds to GitHub releases
ApolloFops Aug 29, 2024
2302df5
Change version number
ApolloFops Aug 29, 2024
6aeab81
Add permissions needed for PyPI publishing
ApolloFops Aug 29, 2024
18e5862
Merge release artifacts
ApolloFops Aug 29, 2024
80fdc16
Update release number
ApolloFops Aug 29, 2024
04dc409
Compress Linux releases as tar.gz files
ApolloFops Aug 29, 2024
1c581d9
Add a source file to the tar command
ApolloFops Aug 29, 2024
e7e763a
Add the icon in Tk
ApolloFops Aug 30, 2024
9f2c81d
Bundle the icon in the PyInstaller archive
ApolloFops Aug 30, 2024
2d624d6
Package Windows builds in self-extracting executables
ApolloFops Aug 30, 2024
925b72e
Try a fix to get 7-zip working under Powershell
ApolloFops Aug 30, 2024
e66f55f
Create a zip archive of the Windows build
ApolloFops Aug 30, 2024
84b80a6
Fix workflow file syntax
ApolloFops Aug 30, 2024
e62e262
Increment version number
ApolloFops Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
# Use line wrapping instead of formatting
max_line_length = 1000
121 changes: 121 additions & 0 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Builds the package, and, if the commit has a tag assigned to it, create a release for it and publish it to PyPI
name: Build CI/CD

on:
push:
pull_request:

jobs:
# Builds the package and uploads a build artifiact
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: distribution-archives
path: dist/*

# Builds binaries with pyinstaller
pyinstaller:
strategy:
matrix:
os: ['ubuntu', 'windows', 'macos']
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.12'
- name: Install dependencies
run: pip install .[packaging]
- name: Build executable
run: pyinstaller --noconfirm pyinstaller.spec
- name: Create .dmg
if: runner.os == 'macOS'
run: |
brew update
brew install create-dmg
mkdir -p dist/dmg
mv dist/*.app dist/dmg
create-dmg \
--volname "E-mail Draft Generator" \
--volicon "assets/icon.png" \
--window-pos 200 120 \
--window-size 600 300 \
--icon-size 100 \
--icon "E-mail Draft Generator.app" 175 120 \
--hide-extension "E-mail Draft Generator.app" \
--app-drop-link 425 120 \
"dist/E-mail Draft Generator.dmg" \
"dist/dmg/"
rm -r "dist/E-mail Draft Generator" "dist/dmg"
- name: Create .tar.gz
if: runner.os == 'Linux'
run: |
mkdir release-archives
tar -czvf release-archives/email-draft-generator-linux-x86_64.tar.gz -C dist .
rm -r "dist/E-mail Draft Generator"
cp release-archives/*.tar.gz dist
- name: Create .zip
if: runner.os == 'Windows'
run: |
Compress-Archive -Path "dist\E-mail Draft Generator" -DestinationPath email-draft-generator-windows-x86_64.zip
move email-draft-generator-windows-x86_64.zip dist
- name: Create self-extracting executable
if: runner.os == 'Windows'
run: |
& "C:\Program Files\7-Zip\7z.exe" a email-draft-generator-windows-sfx-x86_64.exe -mx5 -sfx "dist\E-mail Draft Generator"
move email-draft-generator-windows-sfx-x86_64.exe dist
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: package-${{ matrix.os }}
path: dist/*

# Creates a release if the commit has a tag associated with it
release:
needs: [build, pyinstaller]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build
uses: actions/download-artifact@v4.1.7
with:
path: dist
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*

# Publish to PyPI if the commit has a tag associated with it
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Download build
uses: actions/download-artifact@v4.1.7
with:
name: distribution-archives
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
169 changes: 168 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,168 @@
companies.json
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
#*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# OS-specific stuff
.DS_Store

# Runtime data files
.credentials
4 changes: 4 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[style]
USE_TABS = true
COLUMN_LIMIT = 10000
INDENT_BLANK_LINES = true
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
Loading