From 87488eaf99c328ec428bea1ba1336b4e04158296 Mon Sep 17 00:00:00 2001 From: Interitio Date: Sun, 15 Sep 2024 11:52:56 +1000 Subject: [PATCH] feat (timer): Add support for new timer layout. --- .gitmodules | 4 ++-- skins | 2 +- src/gui | 2 +- tests/__init__.py | 7 +++++++ tests/gui/__init__.py | 0 tests/gui/cards/goal_sample.py | 4 ++-- tests/gui/cards/pomo_sample.py | 15 +++++++++++++++ 7 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/gui/__init__.py create mode 100644 tests/gui/cards/pomo_sample.py diff --git a/.gitmodules b/.gitmodules index bd5ca8a8..f3a33f00 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "bot/gui"] path = src/gui - url = https://github.com/StudyLions/StudyLion-Plugin-GUI.git + url = git@github.com:Intery/CafeHelper-GUI.git [submodule "skins"] path = skins - url = https://github.com/Intery/pillow-skins.git + url = git@github.com:Intery/CafeHelper-Skins.git [submodule "src/modules/voicefix"] path = src/modules/voicefix url = https://github.com/Intery/StudyLion-voicefix.git diff --git a/skins b/skins index d3d6a28b..68685732 160000 --- a/skins +++ b/skins @@ -1 +1 @@ -Subproject commit d3d6a28bc9c573efe76780aedab1c87b4856f0c0 +Subproject commit 686857321ed16a45c38895417417b01ed9361f4b diff --git a/src/gui b/src/gui index c1bcb05c..40bc1403 160000 --- a/src/gui +++ b/src/gui @@ -1 +1 @@ -Subproject commit c1bcb05c25cd2ecec7dd726d55d30606b6b5c99b +Subproject commit 40bc14035593ee18d351b86e958d1882035b01ef diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..3d7a868a --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,7 @@ +# !/bin/python3 + +import sys +import os + +sys.path.insert(0, os.path.join(os.getcwd())) +sys.path.insert(0, os.path.join(os.getcwd(), "src")) diff --git a/tests/gui/__init__.py b/tests/gui/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/gui/cards/goal_sample.py b/tests/gui/cards/goal_sample.py index 7395e83f..39a4ad03 100644 --- a/tests/gui/cards/goal_sample.py +++ b/tests/gui/cards/goal_sample.py @@ -1,11 +1,11 @@ import asyncio import datetime as dt -from src.cards import WeeklyGoalCard +from gui.cards import WeeklyGoalCard async def get_card(): card = await WeeklyGoalCard.generate_sample() - with open('samples/weekly-sample.png', 'wb') as image_file: + with open('output/weekly-sample.png', 'wb') as image_file: image_file.write(card.fp.read()) if __name__ == '__main__': diff --git a/tests/gui/cards/pomo_sample.py b/tests/gui/cards/pomo_sample.py new file mode 100644 index 00000000..3658440d --- /dev/null +++ b/tests/gui/cards/pomo_sample.py @@ -0,0 +1,15 @@ +import asyncio +import datetime as dt +from gui.cards import BreakTimerCard, FocusTimerCard + + +async def get_card(): + card = await BreakTimerCard.generate_sample() + with open('output/break_timer_sample.png', 'wb') as image_file: + image_file.write(card.fp.read()) + card = await FocusTimerCard.generate_sample() + with open('output/focus_timer_sample.png', 'wb') as image_file: + image_file.write(card.fp.read()) + +if __name__ == '__main__': + asyncio.run(get_card())