From 8226a14b0054f9f5fa8076c1e5ba7b05719cf257 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 25 Apr 2020 20:31:08 -0700 Subject: [PATCH] Add dependencies for MacOS system tray icon --- .github/workflows/publish-release.yml | 2 +- Tautulli.py | 9 ++++++++- package/Tautulli-macos.spec | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5b04c4bd..0fc1d4f3 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -95,7 +95,7 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install pyopenssl pycryptodomex pyinstaller + pip install pyopenssl pycryptodomex pyinstaller pyobjc - name: Build Package run: | diff --git a/Tautulli.py b/Tautulli.py index 53514f96..da519122 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -236,7 +236,7 @@ def main(): try: import OpenSSL except ImportError: - logger.warn("The pyOpenSSL module is missing. Install this " \ + logger.warn("The pyOpenSSL module is missing. Install this " "module to enable HTTPS. HTTPS will be disabled.") plexpy.CONFIG.ENABLE_HTTPS = False @@ -256,6 +256,13 @@ def main(): plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, plexpy.HTTP_PORT, plexpy.HTTP_ROOT) + try: + import AppKit + except ImportError: + logger.warn("The pyobjc module is missing. Install this " + "module to enable the system tray icon.") + plexpy.CONFIG.SYS_TRAY_ICON = False + if common.PLATFORM == 'Darwin' and plexpy.CONFIG.SYS_TRAY_ICON: # MacOS system tray icon must be run on the main thread and is blocking # Start the rest of Tautulli on a new thread diff --git a/package/Tautulli-macos.spec b/package/Tautulli-macos.spec index c1936f4e..1bd865a1 100644 --- a/package/Tautulli-macos.spec +++ b/package/Tautulli-macos.spec @@ -18,6 +18,7 @@ analysis = Analysis( ('../version.txt', '.') ], excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], + hiddenimports=['Foundation', 'AppKit'], cipher=block_cipher ) pyz = PYZ(