mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix Constant.PythonPath not being set when python path is already specified.
This commit is contained in:
parent
61aaa0129d
commit
d96f515944
1 changed files with 11 additions and 7 deletions
|
|
@ -83,7 +83,10 @@ namespace Flow.Launcher.Core.Plugin
|
|||
return;
|
||||
}
|
||||
|
||||
plugins.Add(new PluginPair {Plugin = plugin, Metadata = metadata});
|
||||
plugins.Add(new PluginPair
|
||||
{
|
||||
Plugin = plugin, Metadata = metadata
|
||||
});
|
||||
});
|
||||
metadata.InitTime += milliseconds;
|
||||
}
|
||||
|
|
@ -114,10 +117,12 @@ namespace Flow.Launcher.Core.Plugin
|
|||
return new List<PluginPair>();
|
||||
|
||||
if (!string.IsNullOrEmpty(settings.PythonDirectory) && FilesFolders.LocationExists(settings.PythonDirectory))
|
||||
{
|
||||
Constant.PythonPath = settings.PythonDirectory;
|
||||
return SetPythonPathForPluginPairs(source, Path.Combine(settings.PythonDirectory, PythonExecutable));
|
||||
|
||||
}
|
||||
var pythonPath = string.Empty;
|
||||
|
||||
|
||||
if (MessageBox.Show("Flow detected you have installed Python plugins, which " +
|
||||
"will need Python to run. Would you like to download Python? " +
|
||||
Environment.NewLine + Environment.NewLine +
|
||||
|
|
@ -186,16 +191,15 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
|
||||
private static IEnumerable<PluginPair> SetPythonPathForPluginPairs(List<PluginMetadata> source, string pythonPath)
|
||||
=> source
|
||||
=> source
|
||||
.Where(o => o.Language.ToUpper() == AllowedLanguage.Python)
|
||||
.Select(metadata => new PluginPair
|
||||
{
|
||||
Plugin = new PythonPlugin(pythonPath),
|
||||
Metadata = metadata
|
||||
Plugin = new PythonPlugin(pythonPath), Metadata = metadata
|
||||
})
|
||||
.ToList();
|
||||
|
||||
public static IEnumerable<PluginPair> ExecutablePlugins(IEnumerable<PluginMetadata> source)
|
||||
public static IEnumerable<PluginPair> ExecutablePlugins(IEnumerable<PluginMetadata> source)
|
||||
{
|
||||
return source
|
||||
.Where(o => o.Language.ToUpper() == AllowedLanguage.Executable)
|
||||
|
|
|
|||
Loading…
Reference in a new issue