2014-01-11 08:02:17 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2013-12-20 12:38:10 +01:00
|
|
|
|
using System.Linq;
|
2013-12-25 12:26:58 +01:00
|
|
|
|
using System.Threading;
|
2014-01-10 17:19:14 +01:00
|
|
|
|
using Python.Runtime;
|
2014-01-29 11:33:24 +01:00
|
|
|
|
using Wox.Plugin;
|
2013-12-20 12:38:10 +01:00
|
|
|
|
|
2014-01-29 11:33:24 +01:00
|
|
|
|
namespace Wox.PluginLoader
|
2013-12-20 12:38:10 +01:00
|
|
|
|
{
|
2013-12-20 18:20:17 +01:00
|
|
|
|
public class PythonPluginLoader : BasePluginLoader
|
2013-12-20 12:38:10 +01:00
|
|
|
|
{
|
2013-12-20 18:20:17 +01:00
|
|
|
|
public override List<PluginPair> LoadPlugin()
|
2013-12-20 12:38:10 +01:00
|
|
|
|
{
|
2013-12-20 18:20:17 +01:00
|
|
|
|
List<PluginPair> plugins = new List<PluginPair>();
|
|
|
|
|
List<PluginMetadata> metadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.Python.ToUpper()).ToList();
|
|
|
|
|
foreach (PluginMetadata metadata in metadatas)
|
|
|
|
|
{
|
2013-12-23 12:21:51 +01:00
|
|
|
|
PythonPluginWrapper python = new PythonPluginWrapper(metadata);
|
2013-12-20 18:20:17 +01:00
|
|
|
|
PluginPair pair = new PluginPair()
|
|
|
|
|
{
|
|
|
|
|
Plugin = python,
|
|
|
|
|
Metadata = metadata
|
|
|
|
|
};
|
|
|
|
|
plugins.Add(pair);
|
|
|
|
|
}
|
2013-12-25 12:26:58 +01:00
|
|
|
|
|
2013-12-20 12:38:10 +01:00
|
|
|
|
return plugins;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|