Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public void QueryActionTest()
        {
            Query q = new Query("this");

            q = new Query("ev file.txt");
            Assert.AreEqual(q.ActionName,"ev");
            Assert.AreEqual(q.ActionParameters.Count,1);
            Assert.AreEqual(q.ActionParameters[0],"file.txt");

            q = new Query("ev file.txt file2.txt");
            Assert.AreEqual(q.ActionName,"ev");
            Assert.AreEqual(q.ActionParameters.Count,2);
            Assert.AreEqual(q.ActionParameters[1],"file2.txt");

            q = new Query("ev file.txt file2.tx st");
            Assert.AreEqual(q.GetAllRemainingParameter(), "file.txt file2.tx st");
        }