Files
PowerToys/WinAlfred/PluginLoader/PythonPluginWrapper.cs

42 lines
1004 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2013-12-23 19:21:51 +08:00
using System.Runtime.InteropServices;
using WinAlfred.Plugin;
namespace WinAlfred.PluginLoader
{
public class PythonPluginWrapper : IPlugin
{
2013-12-23 19:21:51 +08:00
private PluginMetadata metadata;
[DllImport("PyWinAlfred.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public extern static void ExecPython(string directory, string file, string query);
static PythonPluginWrapper()
{
}
2013-12-23 19:21:51 +08:00
public PythonPluginWrapper(PluginMetadata metadata)
{
2013-12-23 19:21:51 +08:00
this.metadata = metadata;
}
public List<Result> Query(Query query)
{
List<Result> results = new List<Result>();
2013-12-23 19:21:51 +08:00
ExecPython(metadata.PluginDirecotry, metadata.ExecuteFile.Replace(".py", ""), query.RawQuery);
results.Add(new Result()
{
});
return results;
}
public void Init()
{
}
}
}