Example #1
0
        bool CheckCanExecute(ConfigurationSelector configuration)
        {
            if (!IronManager.IsInterpreterPathValid())
            {
                MessageService.ShowError("Interpreter not set", "A valid interpreter has not been set.");
                return(false);
            }

            var config = (PythonConfiguration)GetConfiguration(configuration);

            if (String.IsNullOrEmpty(config.MainModule))
            {
                MessageService.ShowError("Main module not set", "Main module has not been set.");
                return(false);
            }

            // Try to detect the actual module file.
            var module = config.MainModule.Replace('.', System.IO.Path.DirectorySeparatorChar);
            var path   = config.OutputDirectory.Combine(module).ChangeExtension("py");

            if (!IsFileInProject(path))
            {
                MonoDevelop.Ide.MessageService.ShowError("Main module is missing", "Main module file is missing.");
                return(false);
            }

            return(true);
        }
Example #2
0
        // TODO - Research on the target runtime selection (if possible/doable/recommended).
        protected virtual PythonExecutionCommand CreateExecutionCommand(ConfigurationSelector configSel, PythonConfiguration configuration)
        {
            var ironPath = (FilePath)PropertyService.Get <string> ("IronPython.InterpreterPath");

            var command = new PythonExecutionCommand(ironPath)
            {
                Arguments            = IronManager.GetInterpreterArguments(configuration),
                WorkingDirectory     = BaseDirectory,
                EnvironmentVariables = configuration.GetParsedEnvironmentVariables(),
                Configuration        = configuration
            };

            if (!String.IsNullOrEmpty(configuration.ExtraPaths))
            {
                command.EnvironmentVariables [IronManager.ExtraPathsEnvironmentVariable] = configuration.ExtraPaths;
            }

            return(command);
        }