Add portable python environment

This commit is contained in:
qianlifeng
2014-07-09 18:15:23 +08:00
parent 3efe3d63ce
commit 53cb4189d8
893 changed files with 19533 additions and 42 deletions

21
Wox/RPC/2obywmlm.f50 Normal file
View File

@@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.Linq;
namespace Wox.RPC
{
public class JsonRPC
{
public static string Send(string method, List<string> paras)
{
var list = paras.Select(s => string.Format(@"\""{0}\""", s));
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""params\"": [{1}], \""id\"": 1}}",
method, string.Join(",", list.ToArray()));
}
public static string Send(string method, string para)
{
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""params\"": {1}, \""id\"": 1}}",
method, string.Join(",", list.ToArray()));
}
}
}

View File

@@ -30,33 +30,31 @@ namespace Wox.RPC
public class JsonRPCQueryResponseModel : JsonRPCResponseModel
{
public List<JsonRPCResult> QueryResults
{
get
{
return JsonConvert.DeserializeObject<List<JsonRPCResult>>(Result);
}
}
public new List<JsonRPCResult> Result { get; set; }
}
public class JsonRPCRequestModel : JsonRPCModelBase
{
public string Method { get; set; }
/*
* 1. c# can't use params as the variable name
* 2. all prarmeter should be string type
*/
public List<string> Parameters { get; set; }
/// <summary>
/// counld be list<string> or string type
/// </summary>
public object Parameters { get; set; }
public override string ToString()
{
if (Parameters is string)
{
return string.Format(@"{{\""method\"":\""{0}\"",\""parameters\"":\""{1}\""}}", Method, Parameters);
}
return string.Empty;
}
}
public class JsonRPCResult : Result
{
public string JSONRPCAction { get; set; }
public JsonRPCRequestModel JSONRPCActionModel
{
get { return null; }
}
public JsonRPCRequestModel JsonRPCAction { get; set; }
}
}

View File

@@ -8,13 +8,14 @@ namespace Wox.RPC
public static string Send(string method, List<string> paras)
{
var list = paras.Select(s => string.Format(@"\""{0}\""", s));
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""params\"": [{1}], \""id\"": 1}}",
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""parameters\"": [{1}], \""id\"": 1}}",
method, string.Join(",", list.ToArray()));
}
public static string Send(string method, string para)
{
return Send(method, new List<string>() { para });
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""parameters\"": \""{1}\"", \""id\"": 1}}",
method, para);
}
}
}

56
Wox/RPC/tr3fzfc4.och Normal file
View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using System.Windows.Documents;
using Newtonsoft.Json;
using Wox.Plugin;
namespace Wox.RPC
{
public class JsonRPCErrorModel
{
public int Code { get; set; }
public string Message { get; set; }
public string Data { get; set; }
}
public class JsonRPCModelBase
{
public int Id { get; set; }
public string JsonRPC { get; set; }
}
public class JsonRPCResponseModel : JsonRPCModelBase
{
public string Result { get; set; }
public JsonRPCErrorModel Error { get; set; }
}
public class JsonRPCQueryResponseModel : JsonRPCResponseModel
{
public new List<JsonRPCResult> Result { get; set; }
}
public class JsonRPCRequestModel : JsonRPCModelBase
{
public string Method { get; set; }
/// <summary>
/// counld be list<string> or string type
/// </summary>
public object Parameters { get; set; }
public override string ToString()
{
if(typeof(Parameters))
return string.Format(@"{""method"":}",Method,Parameters);
}
}
public class JsonRPCResult : Result
{
public JsonRPCRequestModel JsonRPCAction { get; set; }
}
}