diff --git a/Plugins/WinAlfred.Plugin.DouBan/main.py b/Plugins/WinAlfred.Plugin.DouBan/main.py
index 00eaf442d9..ef19d229ef 100644
--- a/Plugins/WinAlfred.Plugin.DouBan/main.py
+++ b/Plugins/WinAlfred.Plugin.DouBan/main.py
@@ -7,6 +7,8 @@ class PyWinAlfred():
def query(self,key):
k = key.split(" ")[1]
+ if not k:
+ return ""
r = requests.get('http://movie.douban.com/subject_search?search_text=' + k)
bs = BeautifulSoup(r.text)
results = []
diff --git a/PyWinAlfred.Test/Source.cpp b/PyWinAlfred.Test/Source.cpp
index 910f0d8c5c..66596489ed 100644
--- a/PyWinAlfred.Test/Source.cpp
+++ b/PyWinAlfred.Test/Source.cpp
@@ -23,6 +23,8 @@ char* Exec(char* directory, char* file, char* method, char* para)
PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pClass, *pInstance;
char *error;
+ // Æô¶¯×ÓÏß³ÌǰִÐУ¬ÎªÁËÊÍ·ÅPyEval_InitThreads»ñµÃµÄÈ«¾ÖËø£¬·ñÔò×ÓÏ߳̿ÉÄÜÎÞ·¨»ñÈ¡µ½È«¾ÖËø¡£
+ PyEval_ReleaseLock();
PyGILState_STATE gstate = PyGILState_Ensure();
// Initialise the Python interpreter
@@ -97,20 +99,19 @@ char* Exec(char* directory, char* file, char* method, char* para)
int main(int argc, char *argv[])
{
- char* directory = "d:\\github\\WinAlfred\\WinAlfred\\bin\\Debug\\Plugins\\p";
+ char* directory = "d:\\github\\WinAlfred\\Plugins\\WinAlfred.Plugin.DouBan\\";
char* file = "main";
char* method = "query";
- char* para1 = "p 1";
- char* para2 = "p 2";
- char* para3 = "p 3";
- char* para4 = "p 4";
+ char* para1 = "movie 1";
+ char* para2 = "movie 2";
+ char* para3 = "movie 3";
+ char* para4 = "movie 4";
int i = 0;
// ³õʼ»¯
Py_Initialize();
// ³õʼ»¯Ïß³ÌÖ§³Ö
PyEval_InitThreads();
-PyEval_ReleaseLock();
- // Æô¶¯×ÓÏß³ÌǰִÐУ¬ÎªÁËÊÍ·ÅPyEval_InitThreads»ñµÃµÄÈ«¾ÖËø£¬·ñÔò×ÓÏ߳̿ÉÄÜÎÞ·¨»ñÈ¡µ½È«¾ÖËø¡£
+
//std::async(Exec,directory,file,method,para);
std::async(Exec,directory,file,method,para1);
std::async(Exec,directory,file,method,para2);
diff --git a/PyWinAlfred/Main.cpp b/PyWinAlfred/Main.cpp
index 22f4aeabc9..9ba66cbb36 100644
--- a/PyWinAlfred/Main.cpp
+++ b/PyWinAlfred/Main.cpp
@@ -9,7 +9,6 @@ extern "C" __declspec(dllexport) void InitPythonEnv()
{
Py_Initialize();
PyEval_InitThreads();
- PyEval_ReleaseLock();
// Æô¶¯×ÓÏß³ÌǰִÐУ¬ÎªÁËÊÍ·ÅPyEval_InitThreads»ñµÃµÄÈ«¾ÖËø£¬·ñÔò×ÓÏ߳̿ÉÄÜÎÞ·¨»ñÈ¡µ½È«¾ÖËø¡£
}
@@ -32,8 +31,8 @@ char* Exec(char* directory, char* file, char* method, char* para)
PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pClass, *pInstance;
char *error;
+ PyEval_ReleaseLock();
PyGILState_STATE gstate = PyGILState_Ensure();
-
// Build the name object
PyObject *path = PySys_GetObject("path");
PyList_Append(path, PyString_FromString(directory));
@@ -91,14 +90,13 @@ char* Exec(char* directory, char* file, char* method, char* para)
//PyErr_Clear();
PyGILState_Release(gstate);
-
return str_ret;
}
extern "C" __declspec(dllexport) char* ExecPython(char* directory, char* file, char* method, char* para)
{
+ //PyEval_ReleaseLock();
char* s = Exec(directory,file,method,para);
- PyGILState_Ensure();
return s;
//auto future = std::async(Exec,directory,file,method,para);
//return future.get();
diff --git a/WinAlfred.sln b/WinAlfred.sln
index f2b65b9cb7..f74b7a503e 100644
--- a/WinAlfred.sln
+++ b/WinAlfred.sln
@@ -104,7 +104,8 @@ Global
{353769D3-D11C-4D86-BD06-AC8C1D68642B}.Release|Win32.ActiveCfg = Release|Any CPU
{353769D3-D11C-4D86-BD06-AC8C1D68642B}.Release|x64.ActiveCfg = Release|Any CPU
{353769D3-D11C-4D86-BD06-AC8C1D68642B}.Release|x86.ActiveCfg = Release|Any CPU
- {D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Any CPU.Build.0 = Debug|x64
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -122,7 +123,7 @@ Global
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Release|x64.Build.0 = Release|x64
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Release|x86.ActiveCfg = Release|Win32
{D03FD663-38A8-4C1A-8431-EB44F93E7EBA}.Release|x86.Build.0 = Release|Win32
- {05D72D92-4010-4F92-A147-906930241573}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {05D72D92-4010-4F92-A147-906930241573}.Debug|Any CPU.ActiveCfg = Debug|x64
{05D72D92-4010-4F92-A147-906930241573}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{05D72D92-4010-4F92-A147-906930241573}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{05D72D92-4010-4F92-A147-906930241573}.Debug|Win32.ActiveCfg = Debug|Win32
diff --git a/WinAlfred/App.config b/WinAlfred/App.config
index e1eb5518f6..01c0f5391e 100644
--- a/WinAlfred/App.config
+++ b/WinAlfred/App.config
@@ -17,4 +17,4 @@
-
+
diff --git a/WinAlfred/MainWindow.xaml.cs b/WinAlfred/MainWindow.xaml.cs
index 35fd1f2992..1e5279364d 100644
--- a/WinAlfred/MainWindow.xaml.cs
+++ b/WinAlfred/MainWindow.xaml.cs
@@ -8,7 +8,6 @@ using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-using IWshRuntimeLibrary;
using Microsoft.Win32;
using WinAlfred.Commands;
using WinAlfred.Helper;
@@ -153,21 +152,21 @@ namespace WinAlfred
private void SetAutoStart(bool IsAtuoRun)
{
- string LnkPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "//WinAlfred.lnk";
- if (IsAtuoRun)
- {
- WshShell shell = new WshShell();
- IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(LnkPath);
- shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
- shortcut.WorkingDirectory = Environment.CurrentDirectory;
- shortcut.WindowStyle = 1; //normal window
- shortcut.Description = "WinAlfred";
- shortcut.Save();
- }
- else
- {
- System.IO.File.Delete(LnkPath);
- }
+ //string LnkPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "//WinAlfred.lnk";
+ //if (IsAtuoRun)
+ //{
+ // WshShell shell = new WshShell();
+ // IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(LnkPath);
+ // shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
+ // shortcut.WorkingDirectory = Environment.CurrentDirectory;
+ // shortcut.WindowStyle = 1; //normal window
+ // shortcut.Description = "WinAlfred";
+ // shortcut.Save();
+ //}
+ //else
+ //{
+ // System.IO.File.Delete(LnkPath);
+ //}
}
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
diff --git a/WinAlfred/PluginLoader/Plugins.cs b/WinAlfred/PluginLoader/Plugins.cs
index 06bbceb65b..e967a9edea 100644
--- a/WinAlfred/PluginLoader/Plugins.cs
+++ b/WinAlfred/PluginLoader/Plugins.cs
@@ -19,7 +19,9 @@ namespace WinAlfred.PluginLoader
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin))
{
IPlugin plugin1 = plugin;
- ThreadPool.QueueUserWorkItem(o => plugin1.Init(new PluginInitContext()
+ //ThreadPool.QueueUserWorkItem(o =>);
+
+ plugin1.Init(new PluginInitContext()
{
Plugins = plugins,
ChangeQuery = s => window.ChangeQuery(s),
@@ -27,7 +29,7 @@ namespace WinAlfred.PluginLoader
HideApp = window.HideApp,
ShowApp = window.ShowApp,
ShowMsg = (title, subTitle, iconPath) => window.ShowMsg(title, subTitle, iconPath)
- }));
+ });
}
}
diff --git a/WinAlfred/WinAlfred.csproj b/WinAlfred/WinAlfred.csproj
index 66418b728f..1966a6fa4d 100644
--- a/WinAlfred/WinAlfred.csproj
+++ b/WinAlfred/WinAlfred.csproj
@@ -9,7 +9,7 @@
Properties
WinAlfred
WinAlfred
- v3.5
+ v4.0
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
@@ -191,17 +191,6 @@
-
-
- {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}
- 1
- 0
- 0
- tlbimp
- False
- True
-
-
diff --git a/WinAlfred/packages.config b/WinAlfred/packages.config
index 0db9c4556d..e25e951af7 100644
--- a/WinAlfred/packages.config
+++ b/WinAlfred/packages.config
@@ -1,5 +1,5 @@

-
-
+
+
\ No newline at end of file