Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lock9 committed Mar 1, 2019
1 parent da981c6 commit ab386de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Neo-Debugger-Core-UnitTests/InvocationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void TestPythonCompiler()
var fullFilePath = Path.Combine(path, "NEP5.py");
var sourceCode = File.ReadAllText(fullFilePath);
Assert.NotNull(sourceCode);
var compiled = compiler.CompileContract(sourceCode, fullFilePath, Neo.Debugger.Core.Data.SourceLanguage.Python);
var compiled = compiler.CompileContract(sourceCode, fullFilePath, Neo.Debugger.Core.Data.SourceLanguage.Python, "/Users/ricardmprado/Workspace/neo-boa/");
Assert.IsTrue(compiled);
}

Expand Down
6 changes: 3 additions & 3 deletions Neo-Debugger-Core/Utils/NeonCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public bool CompileCSharpContract(string sourceCode, string outputFilePath)
return true;
}

public bool CompilePythonContract(string sourceCode, string outputFilePath)
public bool CompilePythonContract(string sourceCode, string outputFilePath, string compilerPath = null)
{
if (string.IsNullOrEmpty(outputFilePath))
throw new ArgumentNullException(nameof(outputFilePath));

File.WriteAllText(outputFilePath, sourceCode);

if (PythonCompilerProxy.Execute(outputFilePath, PythonCompilerExecutableName(), (m) => { SendToLog?.Invoke(this, new CompilerLogEventArgs() { Message = m }); }))
if (PythonCompilerProxy.Execute(outputFilePath, PythonCompilerExecutableName(), (m) => { SendToLog?.Invoke(this, new CompilerLogEventArgs() { Message = m }); }, compilerPath))
{
SendToLog?.Invoke(this, new CompilerLogEventArgs() { Message = "SUCC" });
}
Expand All @@ -91,7 +91,7 @@ public bool CompileContract(string sourceCode, string outputFilePath, SourceLang
}
else if (language == SourceLanguage.Python)
{
return CompilePythonContract(sourceCode, outputFilePath);
return CompilePythonContract(sourceCode, outputFilePath, compilerPath);
}
else
{
Expand Down

0 comments on commit ab386de

Please sign in to comment.