Skip to content

Commit 665f928

Browse files
committed
build: 👷 add poetry to project
add: new install and runner scripts. poetry to manage dependencies and installation.
1 parent df65864 commit 665f928

8 files changed

+622
-11
lines changed

gramma_starter.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
@echo off
2-
cd %~dp0
3-
start "" pythonw "gramma.py"
2+
start /B gramma_to_tray_win.vbs
43
exit

gramma_starter_linux.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
2-
cd "$(dirname "$0")"
3-
pythonw gramma.py &
2+
nohup poetry run python gramma.py >/dev/null 2>&1 &
3+
disown
4+
exit

gramma_to_tray_win.vbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Set WshShell = CreateObject("WScript.Shell")
2+
WshShell.Run "poetry run python gramma.py", 0
3+
Set WshShell = Nothing

install_linux.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
echo "Verifying poetry..."
3+
pip install poetry
4+
echo "Installing gramma..."
5+
poetry install
6+
if [ $? -ne 0 ]; then
7+
echo "Installation failed. Please ensure Poetry is installed and try again."
8+
exit 1
9+
fi
10+
11+
echo "Creating shortcut..."
12+
SHORTCUT_PATH="$HOME/Desktop/Gramma.desktop"
13+
echo "[Desktop Entry]" > "$SHORTCUT_PATH"
14+
echo "Version=1.0.0" >> "$SHORTCUT_PATH"
15+
echo "Type=Application" >> "$SHORTCUT_PATH"
16+
echo "Description=Transform your clipboard into a smart text assistant." >> "$SHORTCUT_PATH"
17+
echo "Terminal=false" >> "$SHORTCUT_PATH"
18+
echo "Exec=$PWD/gramma_starter.sh" >> "$SHORTCUT_PATH"
19+
echo "Name=Gramma" >> "$SHORTCUT_PATH"
20+
echo "Comment=Start Gramma" >> "$SHORTCUT_PATH"
21+
echo "Icon=$PWD/src/images/app_icon.ico" >> "$SHORTCUT_PATH"
22+
chmod +x "$SHORTCUT_PATH"
23+
24+
echo "gramma has been installed successfully."

install_windows.bat

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@echo off
2+
title Gramma - Installing dependencies and creating shortcuts, please wait...
3+
4+
cd /d %~dp0
5+
6+
echo Verifying poetry...
7+
pip install poetry
8+
9+
echo Installing gramma...
10+
python -m poetry install
11+
if %ERRORLEVEL% neq 0 (
12+
echo Installation failed. Please ensure Poetry is installed and try again.
13+
exit /b %ERRORLEVEL%
14+
)
15+
16+
echo Creating shortcut...
17+
powershell -Command "$WScriptShell = New-Object -ComObject WScript.Shell; $Shortcut = $WScriptShell.CreateShortcut('%USERPROFILE%\Desktop\Gramma.lnk'); $Shortcut.TargetPath = '%CD%\gramma_starter.bat'; $Shortcut.WorkingDirectory = '%CD%'; $Shortcut.IconLocation = '%CD%\src\images\app_icon.ico'; $Shortcut.Description = 'Transform your clipboard into a smart text assistant.'; $Shortcut.Save()"
18+
19+
echo gramma has been installed successfully.
20+
pause

poetry.lock

Lines changed: 549 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.poetry]
2+
name = "gramma"
3+
version = "1.0.0"
4+
description = "Transform your clipboard into a smart text assistant."
5+
authors = ["Elly <[email protected]>"]
6+
license = "MIT"
7+
readme = "README.md"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.11"
11+
customtkinter = "^5.2.2"
12+
groq = "^0.8.0"
13+
pillow = "^10.3.0"
14+
plyer = "^2.1.0"
15+
pyperclip = "^1.8.2"
16+
pystray = "^0.19.5"
17+
pywin32 = "^306"
18+
19+
20+
[build-system]
21+
requires = ["poetry-core"]
22+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)