public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments) { var compiledCode = aScriptSource.Compile(compilerOptions, errorListener); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { return(null); } return(essenceScriptCode.Run(scriptScope.scope(), arguments)); }
public static Object Execute(this ScriptSource aScriptSource, ScriptScope scriptScope, Object[] arguments) { var compiledCode = aScriptSource.Compile(); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { return(null); } return(essenceScriptCode.Run(scriptScope.scope(), arguments)); }
public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, Object[] arguments) { var compiledCode = aScriptSource.Compile(compilerOptions); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { return(null); } return(essenceScriptCode.Run(arguments)); }
public static Object Execute(this ScriptSource aScriptSource, ErrorListener errorListener, Object[] arguments) { var compiledCode = aScriptSource.Compile(errorListener); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { return(null); } return(essenceScriptCode.Run(arguments)); }
/// <summary> /// Run the script and import all the variables/functions/objects to scope /// </summary> /// <param name="path">path to python script</param> /// <returns>True if file found and loaded, false otherwise</returns> /// <remarks>No errors will be raised in case the file does not exist</remarks> public bool LoadScript(string path) { if (my.FileSystem.FileExists(path)) { Debug.Print("loading script " + path.Split('\\').Last()); gScript = Engine.CreateScriptSourceFromFile(path); gScript.Compile(); gScript.Execute(EngineScope); return(true); } return(false); }
public static Object Execute(this ScriptSource aScriptSource, ESCompilerOptions compilerOptions, ErrorListener errorListener, ScriptScope scriptScope, Object[] arguments, out TimeSpan durationToRun) { var compiledCode = aScriptSource.Compile(compilerOptions, errorListener); var essenceScriptCode = compiledCode.essenceScriptCode(); if (essenceScriptCode == null) { durationToRun = TimeSpan.Zero; return(null); } var value = essenceScriptCode.Run(scriptScope.scope(), arguments); durationToRun = essenceScriptCode.DurationToRun; return(value); }
/// <summary> /// Run the script and import all the variables/functions/objects to scope /// </summary> /// <param name="path">path to python script</param> /// <returns>True if file found and loaded, false otherwise</returns> /// <remarks>No errors will be raised in case the file does not exist</remarks> public bool LoadScript(string path) { if (my.FileSystem.FileExists(path)) { gScript = Engine.CreateScriptSourceFromFile(path); gScript.Compile(); gScript.Execute(EngineScope); return true; } return false; }