示例#1
0
        protected override string ExecuteContextMenu(Result selectedResult)
        {
            JsonRPCServerRequestModel request = new JsonRPCServerRequestModel {
                Method     = "contextmenu",
                Parameters = new object[] { selectedResult.ContextData },
            };

            _startInfo.Arguments = $"\"{request}\"";

            return(Execute(_startInfo));
        }
示例#2
0
        protected override string ExecuteQuery(Query query)
        {
            var request = new JsonRPCServerRequestModel
            {
                Method     = "query",
                Parameters = new object[] { query.Search }
            };

            _startInfo.Arguments = $"\"{request}\"";

            return(Execute(_startInfo));
        }
示例#3
0
        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));
        }
示例#4
0
        protected override string ExecuteQuery(Query query)
        {
            JsonRPCServerRequestModel request = new JsonRPCServerRequestModel
            {
                Method = "query",
                Parameters = new object[] { query.GetAllRemainingParameter() },
                HttpProxy = HttpProxy.Instance
            };
            //Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable
            _startInfo.FileName = Path.Combine(PythonHome, "pythonw.exe");
            _startInfo.Arguments = $"-B \"{context.CurrentPluginMetadata.ExecuteFilePath}\" \"{request}\"";

            return Execute(_startInfo);
        }
示例#5
0
文件: PythonPlugin.cs 项目: znatz/Wox
        protected override string ExecuteQuery(Query query)
        {
            JsonRPCServerRequestModel request = new JsonRPCServerRequestModel
            {
                Method     = "query",
                Parameters = new object[] { query.Search },
                HttpProxy  = HttpProxy.Instance
            };

            //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}\"";

            return(Execute(_startInfo));
        }
示例#6
0
        protected override string ExecuteQuery(Query query)
        {
            JsonRPCServerRequestModel request = new JsonRPCServerRequestModel()
            {
                Method     = "query",
                Parameters = new object[] { query.GetAllRemainingParameter() },
                HttpProxy  = HttpProxy.Instance
            };

            //Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable
            startInfo.FileName  = Path.Combine(woxDirectory, "PythonHome\\pythonw.exe");
            startInfo.Arguments = string.Format("-B \"{0}\" \"{1}\"", context.CurrentPluginMetadata.ExecuteFilePath, request);

            return(Execute(startInfo));
        }
示例#7
0
        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));
        }