static PythonDictionary ConvertToPythonDictionary(LaunchResult launchResult)
 {
     return(new PythonDictionary
     {
         ["pid"] = launchResult.Pid
     });
 }
Exemple #2
0
        public PythonDictionary launch(PythonDictionary parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            try
            {
                var launchParameters = ParseLaunchParameters(parameters);
                var result           = new LaunchResult();

                using (var process = StartProcess(launchParameters))
                {
                    result.Pid = process.Id;
                }

                return(result.ConvertToPythonDictionary());
            }
            catch (Exception exception)
            {
                return(new ExceptionPythonModel(exception).ConvertToPythonDictionary());
            }
        }