nice
This commit is contained in:
parent
69891c9d6d
commit
b472cdb62e
8
.env.example
Normal file
8
.env.example
Normal file
@ -0,0 +1,8 @@
|
||||
PYTHON_PATH=path_to_python
|
||||
EMAIL_ADDRESS=example@gmail.com
|
||||
EMAIL_PASSWORD=ztgzegzeg
|
||||
EMAIL_SMTP_SERVER=smtp.gmail.com
|
||||
EMAIL_SMTP_PORT=587
|
||||
LICENSE_API_URL=url
|
||||
PURCHASE_URL=url
|
||||
LICENSE_API_KEY=key
|
||||
@ -82,7 +82,6 @@ class ThemeManager:
|
||||
background-color: {self.current_theme.get_color("background_tertiary_color")};
|
||||
color: {self.current_theme.get_color("text_color")};
|
||||
}}
|
||||
|
||||
QDateEdit {{
|
||||
border: 2px solid {self.current_theme.get_color("border_color")};
|
||||
padding: 5px;
|
||||
@ -90,10 +89,6 @@ class ThemeManager:
|
||||
font-size: 14px;
|
||||
min-height: 30px;
|
||||
}}
|
||||
QDateEdit::drop-down {{
|
||||
border: none;
|
||||
background: transparent;
|
||||
}}
|
||||
QDateEdit:hover {{
|
||||
border-color: {self.current_theme.get_color("primary_hover_color")};
|
||||
}}
|
||||
@ -127,9 +122,6 @@ class ThemeManager:
|
||||
border: none;
|
||||
background: transparent;
|
||||
}}
|
||||
QComboBox::down-arrow {{
|
||||
image: none;
|
||||
}}
|
||||
QComboBox:hover {{
|
||||
border-color: {self.current_theme.get_color("primary_hover_color")};
|
||||
}}
|
||||
@ -215,4 +207,15 @@ class ThemeManager:
|
||||
#tab_bar {{
|
||||
background-color: {self.current_theme.get_color("background_color")};
|
||||
}}
|
||||
|
||||
#icon_label {{
|
||||
background: transparent;
|
||||
border: none;
|
||||
}}
|
||||
|
||||
#text_label {{
|
||||
font-size: 14px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}}
|
||||
"""
|
||||
88
tools/build.command
Normal file
88
tools/build.command
Normal file
@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PARENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
CONFIG_FILE="$PARENT_DIR/config.json"
|
||||
ICON_FILE="$PARENT_DIR/data/assets/icon.png"
|
||||
ENV_FILE="$PARENT_DIR/.env"
|
||||
|
||||
# === Check .env ===
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "[ERROR] .env file not found. Please copy .env.example to .env and configure it."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# === Extract values from config.json ===
|
||||
ICON_PATH=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE'))['icon_path'])")
|
||||
APP_NAME=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE'))['app_name'])")
|
||||
ARCHITECTURE=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE'))['architecture'])")
|
||||
|
||||
# === Extract PYTHON_PATH from .env ===
|
||||
SYSTEM_PYTHON=$(grep '^PYTHON_PATH=' "$ENV_FILE" | cut -d '=' -f2-)
|
||||
|
||||
VENV_PATH="$PARENT_DIR/MACenv_$ARCHITECTURE"
|
||||
APP_FILE="$APP_NAME.app"
|
||||
PYTHON_IN_VENV="$VENV_PATH/bin/python"
|
||||
BUILD_DIR="$PARENT_DIR/build"
|
||||
ZIP_FILE="$BUILD_DIR/$APP_NAME.zip"
|
||||
|
||||
# === Verify Python existence ===
|
||||
if [ ! -x "$SYSTEM_PYTHON" ]; then
|
||||
echo "[ERROR] Python not found at: $SYSTEM_PYTHON"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# === Check virtual environment ===
|
||||
if [ ! -f "$VENV_PATH/bin/activate" ]; then
|
||||
echo "[INFO] Virtual environment not found. Creating..."
|
||||
"$SYSTEM_PYTHON" -m venv "$VENV_PATH"
|
||||
"$PYTHON_IN_VENV" -m pip install --upgrade pip
|
||||
"$PYTHON_IN_VENV" -m pip install -r "$PARENT_DIR/requirements.txt"
|
||||
else
|
||||
echo "[INFO] Virtual environment found."
|
||||
fi
|
||||
|
||||
# === Run PyInstaller ===
|
||||
"$PYTHON_IN_VENV" -m PyInstaller \
|
||||
--distpath "$BUILD_DIR" \
|
||||
--workpath "$BUILD_DIR/dist" \
|
||||
--clean \
|
||||
"$PARENT_DIR/BUILD.spec"
|
||||
|
||||
# === Clean build cache ===
|
||||
rm -rf "$BUILD_DIR/dist"
|
||||
|
||||
# === Create ZIP ===
|
||||
echo "[INFO] Creating ZIP archive..."
|
||||
|
||||
TEMP_ZIP_DIR="$BUILD_DIR/temp_zip"
|
||||
|
||||
# Remove old temp dir
|
||||
rm -rf "$TEMP_ZIP_DIR"
|
||||
mkdir -p "$TEMP_ZIP_DIR"
|
||||
|
||||
# Move compiled app
|
||||
mv "$BUILD_DIR/$APP_FILE" "$TEMP_ZIP_DIR/"
|
||||
|
||||
# Copy config.json
|
||||
cp "$CONFIG_FILE" "$TEMP_ZIP_DIR/"
|
||||
|
||||
# Copy icon.png
|
||||
cp "$ICON_FILE" "$TEMP_ZIP_DIR/"
|
||||
|
||||
# Copy data/lang
|
||||
cp -R "$PARENT_DIR/data/lang" "$TEMP_ZIP_DIR/lang"
|
||||
|
||||
# Remove old ZIP
|
||||
rm -f "$ZIP_FILE"
|
||||
|
||||
# Create ZIP
|
||||
cd "$BUILD_DIR"
|
||||
zip -r "$ZIP_FILE" "temp_zip" >/dev/null
|
||||
|
||||
# Remove temp folder
|
||||
rm -rf "$TEMP_ZIP_DIR"
|
||||
|
||||
echo "[INFO] ZIP created at: $ZIP_FILE"
|
||||
0
tools/open.command
Normal file
0
tools/open.command
Normal file
Loading…
x
Reference in New Issue
Block a user