From bb7900c0e0da0f9a3eefbaa953c19e98cb9c06f6 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Sun, 2 Feb 2025 15:27:02 +0600 Subject: [PATCH] Add PyWin32-related directories to path for Python plugins --- Flow.Launcher.Core/Plugin/PythonPlugin.cs | 4 ++++ Flow.Launcher.Core/Plugin/PythonPluginV2.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 7b670742a..e40b0330e 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -58,6 +58,8 @@ namespace Flow.Launcher.Core.Plugin { var rootDirectory = context.CurrentPluginMetadata.PluginDirectory; var libDirectory = Path.Combine(rootDirectory, "lib"); + var libPyWin32Directory = Path.Combine(libDirectory, "win32"); + var libPyWin32LibDirectory = Path.Combine(libPyWin32Directory, "lib"); var pluginDirectory = Path.Combine(rootDirectory, "plugin"); // This makes it easier for plugin authors to import their own modules. @@ -70,6 +72,8 @@ namespace Flow.Launcher.Core.Plugin import sys sys.path.append(r'{rootDirectory}') sys.path.append(r'{libDirectory}') + sys.path.append(r'{libPyWin32LibDirectory}') + sys.path.append(r'{libPyWin32Directory}') sys.path.append(r'{pluginDirectory}') import runpy diff --git a/Flow.Launcher.Core/Plugin/PythonPluginV2.cs b/Flow.Launcher.Core/Plugin/PythonPluginV2.cs index 03ac0e661..8a9e1ff44 100644 --- a/Flow.Launcher.Core/Plugin/PythonPluginV2.cs +++ b/Flow.Launcher.Core/Plugin/PythonPluginV2.cs @@ -36,6 +36,8 @@ namespace Flow.Launcher.Core.Plugin { var rootDirectory = context.CurrentPluginMetadata.PluginDirectory; var libDirectory = Path.Combine(rootDirectory, "lib"); + var libPyWin32Directory = Path.Combine(libDirectory, "win32"); + var libPyWin32LibDirectory = Path.Combine(libPyWin32Directory, "lib"); var pluginDirectory = Path.Combine(rootDirectory, "plugin"); var filePath = context.CurrentPluginMetadata.ExecuteFilePath; @@ -49,6 +51,8 @@ namespace Flow.Launcher.Core.Plugin import sys sys.path.append(r'{rootDirectory}') sys.path.append(r'{libDirectory}') + sys.path.append(r'{libPyWin32LibDirectory}') + sys.path.append(r'{libPyWin32Directory}') sys.path.append(r'{pluginDirectory}') import runpy