diff --git a/.gitignore b/.gitignore index c9a26d9..e180e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,3 @@ MANIFEST # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest -*.spec \ No newline at end of file diff --git a/REQUIREMENTS.txt b/REQUIREMENTS.txt index 9f26d71..c929c5b 100644 --- a/REQUIREMENTS.txt +++ b/REQUIREMENTS.txt @@ -1,2 +1,3 @@ -Pillow==8.1.1 -pygame==1.9.6 +Pillow +pygame +pyinstaller \ No newline at end of file diff --git a/alarm-clock.spec b/alarm-clock.spec new file mode 100644 index 0000000..34084ee --- /dev/null +++ b/alarm-clock.spec @@ -0,0 +1,50 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['alarm-clock\\app.py'], + pathex=['alarm-clock'], + binaries=[], + datas=[('alarm-clock\\assets', 'assets')], + 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, + [], + exclude_binaries=True, + name='alarm-clock', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='alarm-clock', +) diff --git a/alarm-clock/alarm_sound.py b/alarm-clock/alarm_sound.py index c3b745a..49b7193 100644 --- a/alarm-clock/alarm_sound.py +++ b/alarm-clock/alarm_sound.py @@ -13,7 +13,7 @@ def __init__(self, parent, file="default", set_window=False): self.set_window = set_window self.thread = Thread(target=self.on_active, daemon=True) if file == "default": - self.file = relpath("alarm-clock/assets/sounds/beep_beep.wav") + self.file = relpath("assets/sounds/beep_beep.wav") wav = wave.open(self.file) frequency = wav.getframerate() pygame.mixer.init(frequency=frequency) diff --git a/alarm-clock/app.py b/alarm-clock/app.py index 703f951..d9caf68 100644 --- a/alarm-clock/app.py +++ b/alarm-clock/app.py @@ -28,8 +28,8 @@ def __init__(self, width, height): def configure_window(self): self.title("Alarm Clock") self.geometry(f"{self.width}x{self.height}+100+100") - self.minsize(600, 185) - image_path = relpath("alarm-clock/assets/pictures/icon_2.ico") + self.minsize(300, 185) + image_path = relpath("assets/pictures/icon_2.ico") image = ImageTk.PhotoImage(file=image_path) self.iconphoto(False, image) diff --git a/build-exe.bat b/build-exe.bat new file mode 100644 index 0000000..a07d787 --- /dev/null +++ b/build-exe.bat @@ -0,0 +1 @@ +pyinstaller alarm-clock\app.py -w --add-data alarm-clock\assets;assets --distpath .\dist\windows-x86_64\ --name alarm-clock -p alarm-clock \ No newline at end of file