Refactoring proxy, part 2

This commit is contained in:
bao-qian
2016-06-19 16:18:43 +01:00
parent 764a372e9f
commit 3efeb4a0a6
41 changed files with 98 additions and 146 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Diagnostics;
using Wox.Core.UserSettings;
using Wox.Plugin;
namespace Wox.Core.Plugin
@@ -28,7 +27,6 @@ namespace Wox.Core.Plugin
{
Method = "query",
Parameters = new object[] { query.Search },
HttpProxy = HttpProxy.Instance
};
_startInfo.Arguments = $"\"{request}\"";

View File

@@ -100,18 +100,6 @@ namespace Wox.Core.Plugin
/// </summary>
public class JsonRPCServerRequestModel : JsonRPCRequestModel
{
public IHttpProxy HttpProxy { get; set; }
public override string ToString()
{
string rpc = base.ToString();
if (HttpProxy != null)
{
rpc += string.Format(@",\""proxy\"":{{\""enabled\"":{0},\""server\"":\""{1}\"",\""port\"":{2},\""username\"":\""{3}\"",\""password\"":\""{4}\""}}",
HttpProxy.Enabled.ToString().ToLower(), HttpProxy.Server, HttpProxy.Port, HttpProxy.UserName, HttpProxy.Password);
}
return rpc + "}";
}
}
/// <summary>

View File

@@ -5,11 +5,11 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Wox.Core.Resource;
using Wox.Core.UserSettings;
using Wox.Infrastructure;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.Storage;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
namespace Wox.Core.Plugin
@@ -83,7 +83,6 @@ namespace Wox.Core.Plugin
pair.Plugin.Init(new PluginInitContext
{
CurrentPluginMetadata = pair.Metadata,
Proxy = HttpProxy.Instance,
API = API
});
});

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Wox.Core.UserSettings;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
namespace Wox.Core.Plugin

View File

@@ -1,6 +1,5 @@
using System;
using System.Diagnostics;
using Wox.Core.UserSettings;
using Wox.Plugin;
namespace Wox.Core.Plugin
@@ -28,7 +27,6 @@ namespace Wox.Core.Plugin
{
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}\"";