diff --git a/src/modules/launcher/Wox.Core/Plugin/PluginManager.cs b/src/modules/launcher/Wox.Core/Plugin/PluginManager.cs index 0166690b7b..5c477f44e0 100644 --- a/src/modules/launcher/Wox.Core/Plugin/PluginManager.cs +++ b/src/modules/launcher/Wox.Core/Plugin/PluginManager.cs @@ -42,20 +42,6 @@ namespace Wox.Core.Plugin } } - private static void DeletePythonBinding() - { - const string binding = "wox.py"; - var directory = Constant.PluginsDirectory; - foreach (var subDirectory in Directory.GetDirectories(directory)) - { - var path = Path.Combine(subDirectory, binding); - if (File.Exists(path)) - { - File.Delete(path); - } - } - } - public static void Save() { foreach (var plugin in AllPlugins) @@ -77,8 +63,6 @@ namespace Wox.Core.Plugin static PluginManager() { ValidateUserDirectory(); - // force old plugins use new python binding - DeletePythonBinding(); } /// diff --git a/src/modules/launcher/Wox.Core/Plugin/PluginsLoader.cs b/src/modules/launcher/Wox.Core/Plugin/PluginsLoader.cs index 3f5f9ad320..568bbea378 100644 --- a/src/modules/launcher/Wox.Core/Plugin/PluginsLoader.cs +++ b/src/modules/launcher/Wox.Core/Plugin/PluginsLoader.cs @@ -14,15 +14,12 @@ namespace Wox.Core.Plugin public static class PluginsLoader { public const string PATH = "PATH"; - public const string Python = "python"; - public const string PythonExecutable = "pythonw.exe"; public static List Plugins(List metadatas, PluginsSettings settings) { var csharpPlugins = CSharpPlugins(metadatas).ToList(); - var pythonPlugins = PythonPlugins(metadatas, settings.PythonDirectory); var executablePlugins = ExecutablePlugins(metadatas); - var plugins = csharpPlugins.Concat(pythonPlugins).Concat(executablePlugins).ToList(); + var plugins = csharpPlugins.Concat(executablePlugins).ToList(); return plugins; } @@ -87,55 +84,6 @@ namespace Wox.Core.Plugin return plugins; } - public static IEnumerable PythonPlugins(List source, string pythonDirecotry) - { - var metadatas = source.Where(o => o.Language.ToUpper() == AllowedLanguage.Python); - string filename; - - if (string.IsNullOrEmpty(pythonDirecotry)) - { - var paths = Environment.GetEnvironmentVariable(PATH); - if (paths != null) - { - var pythonPaths = paths.Split(';').Where(p => p.ToLower().Contains(Python)); - if (pythonPaths.Any()) - { - filename = PythonExecutable; - } - else - { - Log.Error("|PluginsLoader.PythonPlugins|Python can't be found in PATH."); - return new List(); - } - } - else - { - Log.Error("|PluginsLoader.PythonPlugins|PATH environment variable is not set."); - return new List(); - } - } - else - { - var path = Path.Combine(pythonDirecotry, PythonExecutable); - if (File.Exists(path)) - { - filename = path; - } - else - { - Log.Error("|PluginsLoader.PythonPlugins|Can't find python executable in (); - } - } - Constant.PythonPath = filename; - var plugins = metadatas.Select(metadata => new PluginPair - { - Plugin = new PythonPlugin(filename), - Metadata = metadata - }); - return plugins; - } - public static IEnumerable ExecutablePlugins(IEnumerable source) { var metadatas = source.Where(o => o.Language.ToUpper() == AllowedLanguage.Executable); diff --git a/src/modules/launcher/Wox.Core/Plugin/PythonPlugin.cs b/src/modules/launcher/Wox.Core/Plugin/PythonPlugin.cs deleted file mode 100644 index 95a7d863e6..0000000000 --- a/src/modules/launcher/Wox.Core/Plugin/PythonPlugin.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using Wox.Infrastructure; -using Wox.Plugin; - -namespace Wox.Core.Plugin -{ - internal class PythonPlugin : JsonRPCPlugin - { - private readonly ProcessStartInfo _startInfo; - public override string SupportedLanguage { get; set; } = AllowedLanguage.Python; - - public PythonPlugin(string filename) - { - _startInfo = new ProcessStartInfo - { - FileName = filename, - UseShellExecute = false, - CreateNoWindow = true, - RedirectStandardOutput = true, - RedirectStandardError = true, - }; - - // temp fix for issue #667 - var path = Path.Combine(Constant.ProgramDirectory, JsonRPC); - _startInfo.EnvironmentVariables["PYTHONPATH"] = path; - - } - - protected override string ExecuteQuery(Query query) - { - JsonRPCServerRequestModel request = new JsonRPCServerRequestModel - { - Method = "query", - Parameters = new object[] { query.Search }, - }; - //Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable - _startInfo.Arguments = $"-B \"{context.CurrentPluginMetadata.ExecuteFilePath}\" \"{request}\""; - // todo happlebao why context can't be used in constructor - _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; - - return Execute(_startInfo); - } - - protected override string ExecuteCallback(JsonRPCRequestModel rpcRequest) - { - _startInfo.Arguments = $"-B \"{context.CurrentPluginMetadata.ExecuteFilePath}\" \"{rpcRequest}\""; - _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; - return Execute(_startInfo); - } - - protected override string ExecuteContextMenu(Result selectedResult) { - JsonRPCServerRequestModel request = new JsonRPCServerRequestModel { - Method = "context_menu", - Parameters = new object[] { selectedResult.ContextData }, - }; - _startInfo.Arguments = $"-B \"{context.CurrentPluginMetadata.ExecuteFilePath}\" \"{request}\""; - _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; - - return Execute(_startInfo); - } - } -} \ No newline at end of file diff --git a/src/modules/launcher/Wox.Core/Wox.Core.csproj b/src/modules/launcher/Wox.Core/Wox.Core.csproj index c7235c9fd5..bb158e7a9f 100644 --- a/src/modules/launcher/Wox.Core/Wox.Core.csproj +++ b/src/modules/launcher/Wox.Core/Wox.Core.csproj @@ -69,7 +69,6 @@ - diff --git a/src/modules/launcher/Wox.Infrastructure/Exception/ExceptionFormatter.cs b/src/modules/launcher/Wox.Infrastructure/Exception/ExceptionFormatter.cs index 91fc5f2f4b..b95cdf1c91 100644 --- a/src/modules/launcher/Wox.Infrastructure/Exception/ExceptionFormatter.cs +++ b/src/modules/launcher/Wox.Infrastructure/Exception/ExceptionFormatter.cs @@ -66,7 +66,6 @@ namespace Wox.Infrastructure.Exception sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}"); sb.AppendLine($"* IntPtr Length: {IntPtr.Size}"); sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}"); - sb.AppendLine($"* Python Path: {Constant.PythonPath}"); sb.AppendLine($"* Everything SDK Path: {Constant.EverythingSDKPath}"); sb.AppendLine($"* CLR Version: {Environment.Version}"); sb.AppendLine($"* Installed .NET Framework: "); diff --git a/src/modules/launcher/Wox.Infrastructure/UserSettings/PluginSettings.cs b/src/modules/launcher/Wox.Infrastructure/UserSettings/PluginSettings.cs index 346d98e534..144fa88f36 100644 --- a/src/modules/launcher/Wox.Infrastructure/UserSettings/PluginSettings.cs +++ b/src/modules/launcher/Wox.Infrastructure/UserSettings/PluginSettings.cs @@ -5,7 +5,6 @@ namespace Wox.Infrastructure.UserSettings { public class PluginsSettings : BaseModel { - public string PythonDirectory { get; set; } public Dictionary Plugins { get; set; } = new Dictionary(); public void UpdatePluginSettings(List metadatas) diff --git a/src/modules/launcher/Wox.Infrastructure/Wox.cs b/src/modules/launcher/Wox.Infrastructure/Wox.cs index d09e7b904c..1604c69960 100644 --- a/src/modules/launcher/Wox.Infrastructure/Wox.cs +++ b/src/modules/launcher/Wox.Infrastructure/Wox.cs @@ -40,7 +40,6 @@ namespace Wox.Infrastructure public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png"); public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png"); - public static string PythonPath; public static string EverythingSDKPath; } } diff --git a/src/modules/launcher/Wox.Plugin/AllowedLanguage.cs b/src/modules/launcher/Wox.Plugin/AllowedLanguage.cs index 840792af3a..2db19ab77a 100644 --- a/src/modules/launcher/Wox.Plugin/AllowedLanguage.cs +++ b/src/modules/launcher/Wox.Plugin/AllowedLanguage.cs @@ -2,11 +2,6 @@ { public static class AllowedLanguage { - public static string Python - { - get { return "PYTHON"; } - } - public static string CSharp { get { return "CSHARP"; } @@ -19,8 +14,7 @@ public static bool IsAllowed(string language) { - return language.ToUpper() == Python.ToUpper() - || language.ToUpper() == CSharp.ToUpper() + return language.ToUpper() == CSharp.ToUpper() || language.ToUpper() == Executable.ToUpper(); } } diff --git a/src/modules/launcher/Wox/Helper/ErrorReporting.cs b/src/modules/launcher/Wox/Helper/ErrorReporting.cs index e6bec5a45a..2b3d91c6a0 100644 --- a/src/modules/launcher/Wox/Helper/ErrorReporting.cs +++ b/src/modules/launcher/Wox/Helper/ErrorReporting.cs @@ -41,8 +41,7 @@ namespace Wox.Helper public static string DependenciesInfo() { - var info = $"\nPython Path: {Constant.PythonPath}" + - $"\nEverything SDK Path: {Constant.EverythingSDKPath}"; + var info = $"\nEverything SDK Path: {Constant.EverythingSDKPath}"; return info; } } diff --git a/src/modules/launcher/Wox/Languages/da.xaml b/src/modules/launcher/Wox/Languages/da.xaml index f6b05597e5..c68024fbef 100644 --- a/src/modules/launcher/Wox/Languages/da.xaml +++ b/src/modules/launcher/Wox/Languages/da.xaml @@ -24,9 +24,7 @@ Sprog Maksimum antal resultater vist Ignorer genvejstaster i fuldskærmsmode - Python bibliotek Autoopdatering - Vælg Skjul Wox ved opstart diff --git a/src/modules/launcher/Wox/Languages/de.xaml b/src/modules/launcher/Wox/Languages/de.xaml index 3efa653e63..a11cbd8013 100644 --- a/src/modules/launcher/Wox/Languages/de.xaml +++ b/src/modules/launcher/Wox/Languages/de.xaml @@ -24,9 +24,7 @@ Sprache Maximale Anzahl Ergebnissen Ignoriere Tastenkombination wenn Fenster im Vollbildmodus ist - Python-Verzeichnis Automatische Aktualisierung - Auswählen Verstecke Wox bei Systemstart diff --git a/src/modules/launcher/Wox/Languages/en.xaml b/src/modules/launcher/Wox/Languages/en.xaml index dca044dc11..cf177cab52 100644 --- a/src/modules/launcher/Wox/Languages/en.xaml +++ b/src/modules/launcher/Wox/Languages/en.xaml @@ -28,9 +28,7 @@ Empty last Query Maximum results shown Ignore hotkeys in fullscreen mode - Python Directory Auto Update - Select Hide Wox on startup Hide tray icon Query Search Precision diff --git a/src/modules/launcher/Wox/Languages/fr.xaml b/src/modules/launcher/Wox/Languages/fr.xaml index 2f8ebc8fc7..ecbcda3ae9 100644 --- a/src/modules/launcher/Wox/Languages/fr.xaml +++ b/src/modules/launcher/Wox/Languages/fr.xaml @@ -28,9 +28,7 @@ Ne pas afficher la dernière recherche Résultats maximums à afficher Ignore les raccourcis lorsqu'une application est en plein écran - Répertoire de Python Mettre à jour automatiquement - Sélectionner Cacher Wox au démarrage diff --git a/src/modules/launcher/Wox/Languages/it.xaml b/src/modules/launcher/Wox/Languages/it.xaml index 7696e9dc9e..a3a826d6a5 100644 --- a/src/modules/launcher/Wox/Languages/it.xaml +++ b/src/modules/launcher/Wox/Languages/it.xaml @@ -28,9 +28,7 @@ Cancella ultima ricerca Numero massimo di risultati mostrati Ignora i tasti di scelta rapida in applicazione a schermo pieno - Cartella Python Aggiornamento automatico - Seleziona Nascondi Wox all'avvio diff --git a/src/modules/launcher/Wox/Languages/ja.xaml b/src/modules/launcher/Wox/Languages/ja.xaml index d9a203a241..598a162bdb 100644 --- a/src/modules/launcher/Wox/Languages/ja.xaml +++ b/src/modules/launcher/Wox/Languages/ja.xaml @@ -28,9 +28,7 @@ 前回のクエリを消去 結果の最大表示件数 ウィンドウがフルスクリーン時にホットキーを無効にする - Pythonのディレクトリ 自動更新 - 選択 起動時にWoxを隠す トレイアイコンを隠す diff --git a/src/modules/launcher/Wox/Languages/ko.xaml b/src/modules/launcher/Wox/Languages/ko.xaml index 7810beec78..28277da284 100644 --- a/src/modules/launcher/Wox/Languages/ko.xaml +++ b/src/modules/launcher/Wox/Languages/ko.xaml @@ -28,9 +28,7 @@ 직전 쿼리 지우기 표시할 결과 수 전체화면 모드에서는 핫키 무시 - Python 디렉토리 자동 업데이트 - 선택 시작 시 Wox 숨김 diff --git a/src/modules/launcher/Wox/Languages/nb-NO.xaml b/src/modules/launcher/Wox/Languages/nb-NO.xaml index c7f294d932..b5dcbdd910 100644 --- a/src/modules/launcher/Wox/Languages/nb-NO.xaml +++ b/src/modules/launcher/Wox/Languages/nb-NO.xaml @@ -28,9 +28,7 @@ Tøm siste spørring Maks antall resultater vist Ignorer hurtigtaster i fullskjermsmodus - Python-mappe Oppdater automatisk - Velg Skjul Wox ved oppstart diff --git a/src/modules/launcher/Wox/Languages/nl.xaml b/src/modules/launcher/Wox/Languages/nl.xaml index ffb77a7933..73aa621093 100644 --- a/src/modules/launcher/Wox/Languages/nl.xaml +++ b/src/modules/launcher/Wox/Languages/nl.xaml @@ -24,9 +24,7 @@ Taal Laat maximale resultaten zien Negeer sneltoetsen in fullscreen mode - Python map Automatische Update - Selecteer Verberg Wox als systeem opstart diff --git a/src/modules/launcher/Wox/Languages/pl.xaml b/src/modules/launcher/Wox/Languages/pl.xaml index f6d638fbc8..b7aa238b95 100644 --- a/src/modules/launcher/Wox/Languages/pl.xaml +++ b/src/modules/launcher/Wox/Languages/pl.xaml @@ -24,9 +24,7 @@ Język Maksymalna liczba wyników Ignoruj skróty klawiszowe w trybie pełnego ekranu - Folder biblioteki Python Automatyczne aktualizacje - Wybierz Uruchamiaj Wox zminimalizowany diff --git a/src/modules/launcher/Wox/Languages/pt-br.xaml b/src/modules/launcher/Wox/Languages/pt-br.xaml index bd4e70f242..6e0b5f2072 100644 --- a/src/modules/launcher/Wox/Languages/pt-br.xaml +++ b/src/modules/launcher/Wox/Languages/pt-br.xaml @@ -28,9 +28,7 @@ Limpar última consulta Máximo de resultados mostrados Ignorar atalhos em tela cheia - Diretório Python Atualizar Automaticamente - Selecionar Esconder Wox na inicialização diff --git a/src/modules/launcher/Wox/Languages/ru.xaml b/src/modules/launcher/Wox/Languages/ru.xaml index 945162b425..f80c3ed1fa 100644 --- a/src/modules/launcher/Wox/Languages/ru.xaml +++ b/src/modules/launcher/Wox/Languages/ru.xaml @@ -24,9 +24,7 @@ Язык Максимальное количество результатов Игнорировать горячие клавиши, если окно в полноэкранном режиме - Python Directory Auto Update - Select Hide Wox on startup diff --git a/src/modules/launcher/Wox/Languages/sk.xaml b/src/modules/launcher/Wox/Languages/sk.xaml index 7a7f083cac..15ee75ad6d 100644 --- a/src/modules/launcher/Wox/Languages/sk.xaml +++ b/src/modules/launcher/Wox/Languages/sk.xaml @@ -28,9 +28,7 @@ Prázdne Max. výsledkov Ignorovať klávesové skraty v režime na celú obrazovku - Priečinok s Pythonom Automatická aktualizácia - Vybrať Schovať Wox po spustení Schovať ikonu v oblasti oznámení diff --git a/src/modules/launcher/Wox/Languages/sr.xaml b/src/modules/launcher/Wox/Languages/sr.xaml index dd8826e1c7..91d6ec6155 100644 --- a/src/modules/launcher/Wox/Languages/sr.xaml +++ b/src/modules/launcher/Wox/Languages/sr.xaml @@ -28,9 +28,7 @@ Isprazni poslednji Upit Maksimum prikazanih rezultata Ignoriši prečice u fullscreen režimu - Python direktorijum Auto ažuriranje - Izaberi Sakrij Wox pri podizanju sistema diff --git a/src/modules/launcher/Wox/Languages/tr.xaml b/src/modules/launcher/Wox/Languages/tr.xaml index 82445e2ac7..2690c79f10 100644 --- a/src/modules/launcher/Wox/Languages/tr.xaml +++ b/src/modules/launcher/Wox/Languages/tr.xaml @@ -28,9 +28,7 @@ Sorgu kutusunu temizle Maksimum sonuç sayısı Tam ekran modunda kısayol tuşunu gözardı et - Python Konumu Otomatik Güncelle - Seç Başlangıçta Wox'u gizle Sistem çekmecesi simgesini gizle Sorgu Arama Hassasiyeti diff --git a/src/modules/launcher/Wox/Languages/uk-UA.xaml b/src/modules/launcher/Wox/Languages/uk-UA.xaml index e114c2706d..ccebeae7ee 100644 --- a/src/modules/launcher/Wox/Languages/uk-UA.xaml +++ b/src/modules/launcher/Wox/Languages/uk-UA.xaml @@ -24,9 +24,7 @@ Мова Максимальна кількість результатів Ігнорувати гарячі клавіші в повноекранному режимі - Директорія Python Автоматичне оновлення - Вибрати Сховати Wox при запуску системи diff --git a/src/modules/launcher/Wox/Languages/zh-cn.xaml b/src/modules/launcher/Wox/Languages/zh-cn.xaml index 679040928c..48f5bc5aca 100644 --- a/src/modules/launcher/Wox/Languages/zh-cn.xaml +++ b/src/modules/launcher/Wox/Languages/zh-cn.xaml @@ -28,9 +28,7 @@ 清空上次搜索关键字 最大结果显示个数 全屏模式下忽略热键 - Python 路径 自动更新 - Select 启动时不显示主窗口 隐藏任务栏图标 diff --git a/src/modules/launcher/Wox/Languages/zh-tw.xaml b/src/modules/launcher/Wox/Languages/zh-tw.xaml index 9b26b0d067..ef0270aa00 100644 --- a/src/modules/launcher/Wox/Languages/zh-tw.xaml +++ b/src/modules/launcher/Wox/Languages/zh-tw.xaml @@ -24,9 +24,7 @@ 語言 最大結果顯示個數 全螢幕模式下忽略熱鍵 - Python 路徑 自動更新 - 選擇 啟動時不顯示主視窗