-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library not working in frozen application (e.g. with PyInstaller) #12
Comments
Hi @MShekow, Sorry to hear that. Could you provide a minimal example so I can try to replicate it? I would expect it to work if you wrap all your code around in an |
Sure. main.py: import argparse
from mac_notifications import client
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("foo")
parser.add_argument("bar")
parser.add_argument("baz")
args = parser.parse_args()
client.create_notification(title="foo", text="bar") pyinstaller.spec: # -*- mode: python ; coding: utf-8 -*-
import sys
block_cipher = None
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
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='testapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
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='testapp',
) Run Console printout:
Also, very funny, I dare you to instead use the following
It gives you a good impression of how it feels to hard-reboot your mac :S |
Any updates on this? Running into the same issue, I'm expecting a notification but the app just starts a new instance |
Thanks again for raising this issue. |
It seems to happen on any frozen python application |
I'm trying to build a CLI/Terminal app (frozen with PyInstaller), and it seems that the macos-notifications library starts a new process that calls my CLI again, but with unexpected parameters. Is there any way to work around this problem?
The text was updated successfully, but these errors were encountered: