Skip to content

Commit

Permalink
feat: enable html mail (#27)
Browse files Browse the repository at this point in the history
* feat: default html format

* feat: enable html mails

* feat: merge logging and gmail

* feat: bump version to v2.3.0
  • Loading branch information
seblum authored Jul 3, 2024
1 parent 9223019 commit 0cf1454
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 221 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ cython_debug/
*.lock
*.pem
.env
**.html

.terraform
.terraform.lock.hcl
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "slotBooker"
version = "2.2.3"
version = "2.3.0"
description = ""
authors = ["Sebastian Blum <hello@seblum.com>"]
packages = [{include = "slotbooker", from = "src"}]
Expand Down
10 changes: 6 additions & 4 deletions src/slotbooker/booker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from selenium.common.exceptions import SessionNotCreatedException, NoSuchDriverException

from .utils.driver import close_driver, get_driver
from .utils.logging import setup_log_dir
from .utils.logging import LogHandler
from .ui_interaction import Booker
from .utils.gmail import send_logs_to_mail
from .utils.settings import set_credentials

# Load configuration files
Expand Down Expand Up @@ -62,7 +61,8 @@ def main(retry: int = 3):
print("TEST OK")
exit()

dir_log_file = setup_log_dir()
log_hander = LogHandler()
dir_log_file = log_hander.setup_log_dir()
logging.basicConfig(
filename=dir_log_file,
filemode="w",
Expand Down Expand Up @@ -117,8 +117,10 @@ def main(retry: int = 3):
response = "FAILED"
continue

html_file = log_hander.convert_logs_to_html()
# stop_logging(file, orig_stdout)
send_logs_to_mail(dir_log_file,response)
# log_hander.send_logs_to_mail(dir_log_file,response)
log_hander.send_logs_to_mail(html_file,response,format="html")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion src/slotbooker/utils/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: Comment fully for local development
# Use second for docker image
# chromedriver: '/usr/local/bin/chromedriver'
chromedriver: '/usr/local/bin/chromedriver-linux64/chromedriver'
# chromedriver: '/usr/local/bin/chromedriver-linux64/chromedriver'

base_url: 'https://app.octivfitness.com/login'
59 changes: 0 additions & 59 deletions src/slotbooker/utils/gmail.py

This file was deleted.

90 changes: 0 additions & 90 deletions src/slotbooker/utils/html_format.py

This file was deleted.

Loading

0 comments on commit 0cf1454

Please sign in to comment.