Пример #1
0
 public void ScriptParserTest()
 {
     using (var py = new IronPythonScript(@"e:\devel\repos\Playnite\source\PlayniteUI\Scripts\IronPython\ExportLibrary.py"))
     {
         Assert.IsNotNull(py.Attributes);
         Assert.IsNotNull(py.FunctionExports);
     }
 }
Пример #2
0
 public IronPythonResponse RunIronPython(IronPythonScript script)
 {
     if (!AllowScript)
     {
         Log(String.Format("Attempt to run IronPython script, but AllowScript=false. Script:\n{0}", script.Script));
         WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Forbidden;
         return(null);
     }
     Log(String.Format("Running IronyPython script:\n{0}", (script.Script.Length > 80)?(script.Script.Substring(0, 75) + "..."):script.Script));
     scriptRunner.Scenario       = Scenario;
     scriptRunner.ProjectHandler = ProjectHandler;
     return(scriptRunner.Run(script));
 }