Compare commits

...
8 Commits
Author SHA1 Message Date
Fredrick W. Warren fd8acf21ec updated icon 2026-01-02 16:05:05 -08:00
Fredrick W. Warren 5a51f49bef startup scripts 2026-01-02 08:21:44 -08:00
Fredrick W. Warren 369bb537d4 updated file permissions 2026-01-02 08:21:16 -08:00
Fredrick W. Warren 2d123e1a74 Switched from PySimpleGUY to FreeSimpleGUI 2026-01-02 08:19:35 -08:00
fwarren ea8930ad14 updated readme 2024-05-24 17:10:45 -07:00
fwarren 802fd2a955 updated readme 2024-05-24 17:08:16 -07:00
fwarren 20b1768bb1 Added readme 2024-05-24 17:04:12 -07:00
fwarren e5a9a5bce3 Added Program Icon 2024-05-24 15:08:52 -07:00
9 changed files with 121 additions and 55 deletions

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
# hcatitles
This program will update the png file found at `D:\OBS Assets\Overlays\title.png`
## Setting up the build environment
Making the assumption that python is installed in `C:\Program Files\Python39` and Develmpent is being done under `D:\Development`
Pull a copy of this project from git:
```
D:\
cd \development
git clone https://git.elder-geek.net/Harvest/hcatitles.git
```
Then setup this foulder with a virtual environment:
```
cd hcatitles
& "C:\Program Files\Python39\python" -m venv venv
```
Activate the virtual enviroment:
```
venv\Script\activate
```
Update `pip `and install requirments:
```
python -m pip install --upgrade pip
pip install -r requisments.txt
```
Testing code after making edits:
```
python hcatitiles.py
```
To create an executable in `D:\Development\hcatitles\dist`:
```
pyinstaller hcatitles.spec
```
## To Activate the virtual enviroment from a new DOS prompt
```
D:\
cd \development\hcatitles
venv\Scripts\activate
```
When done working in the virtual enviroment:
```
deactivate
```
## First time run of pyinstaller to generate hcatitles.spec
Windows uses `^` to continues a command on the next line.
```
pyinstaller --onefile --windowed --icon projector.ico ^
--add-data "blank_title.png:." ^
--add-data "tahoma.ttf:." ^
--add-data "tahomabd.ttf:." ^
--add-data "projector.ico:." ^
hcatitles.py
```
+5 -5
View File
@@ -1,11 +1,10 @@
import os
import PySimpleGUI as sg
import FreeSimpleGUI as sg
from datetime import date, timedelta
from pathlib import Path
from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont, ImageOps
from io import BytesIO
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
@@ -16,7 +15,7 @@ def resource_path(relative_path):
def save_filename():
"""determin file name by platform"""
folder = Path('D:/OBS Assets/Overlays')
folder = Path('C:/Users/harvest/Documents/OBS/Overlays')
if folder.exists():
return folder / 'Title.png'
return Path.home() / 'Pictures' / 'Title.png'
@@ -108,9 +107,10 @@ def main():
original = Image.open(image_path)
image = update_image(original, title, subtitle)
thumbnail = update_thumbnail(image)
icon_file=resource_path('projector.ico')
layout = build_layout(title, subtitle, thumbnail)
window = sg.Window('Harvest Christian Assembly Message Title', layout)
window = sg.Window('Harvest Christian Assembly Message Title', layout, icon=icon_file)
# image contains the final image
while True:
Executable → Regular
+44 -48
View File
@@ -1,48 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['hcatitles.py'],
pathex=[],
binaries=[],
datas=[
('blank_title.png','.'),
('tahoma.ttf','.'),
('tahomabd.ttf','.'),
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='hcatitles',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['hcatitles.py'],
pathex=[],
binaries=[],
datas=[
('blank_title.png','.'),
('tahoma.ttf','.'),
('tahomabd.ttf','.'),
('projector.ico','.'),
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='hcatitles',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['projector.ico'],
)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

+2 -2
View File
@@ -1,5 +1,5 @@
Pillow
pyinstaller
pyinstaller-hooks-contrib
PySimpleGUI==4.60.1
pywin32-ctypes
FreeSimpleGUI
+3
View File
@@ -0,0 +1,3 @@
cd C:\Development\hcatitles
call venv\scripts\activate.bat
python hcatitles.py
+3
View File
@@ -0,0 +1,3 @@
Set objShell = CreateObject("WScript.Shell")
objShell.Run Chr(34) & "C:\Development\hcatitles\startup.bat" & Chr(34), 0
Set objShell = Nothing
Executable → Regular
View File
File mode changed.
Executable → Regular
View File
File mode changed.