Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Flow.Launcher.Core/Plugin/PluginsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
return;
}

plugins.Add(new PluginPair {Plugin = plugin, Metadata = metadata});
plugins.Add(new PluginPair
{
Plugin = plugin, Metadata = metadata
});
});
metadata.InitTime += milliseconds;
}
Expand Down Expand Up @@ -114,10 +117,12 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
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 +
Expand Down Expand Up @@ -186,16 +191,15 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
}

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)
Expand Down