コード例 #1
0
        public void NewInterpreter(IPythonInterpreterFactory factory)
        {
            bool firstInterpreter;

            if (firstInterpreter = !_showSettingsFor.Enabled)
            {
                // previously there were no interpreters installed
                _showSettingsFor.Items.Clear();
                _showSettingsFor.Enabled     = true;
                _startupScript.Enabled       = true;
                _executionMode.Enabled       = true;
                _completionModeGroup.Enabled = true;
                _promptOptionsGroup.Enabled  = true;
            }

            _factories.Add(factory);
            _showSettingsFor.Items.Add(factory.GetInterpreterDisplay());
            OptionsPage._options[factory] = OptionsPage.GetOptions(factory);
            if (firstInterpreter)
            {
                _showSettingsFor.SelectedIndex = 0;
            }

            RefreshOptions();
        }
コード例 #2
0
        private bool IsSameInterpreter(IPythonInterpreterFactory interpreter, string interpreterName)
        {
            if (interpreter.GetInterpreterDisplay() == interpreterName)
            {
                return(true);
            }

            return(false);
        }
コード例 #3
0
        private void QueryStatusMethod(object sender, EventArgs args)
        {
            var oleMenu = sender as OleMenuCommand;

            if (_factory == null)
            {
                oleMenu.Visible   = false;
                oleMenu.Enabled   = false;
                oleMenu.Supported = false;
            }
            else
            {
                oleMenu.Visible   = true;
                oleMenu.Enabled   = true;
                oleMenu.Supported = true;
                oleMenu.Text      = _factory.GetInterpreterDisplay() + " Interactive";
            }
        }
コード例 #4
0
        internal static IReplWindow /*!*/ EnsureReplWindow(IPythonInterpreterFactory factory)
        {
            var compModel = PythonToolsPackage.ComponentModel;
            var provider  = compModel.GetExtensions <IReplWindowProvider>().First();

            string replId = PythonReplEvaluatorProvider.GetReplId(factory);
            var    window = provider.FindReplWindow(replId);

            if (window == null)
            {
                window = provider.CreateReplWindow(
                    PythonToolsPackage.Instance.ContentType,
                    factory.GetInterpreterDisplay() + " Interactive",
                    typeof(PythonLanguageInfo).GUID,
                    replId
                    );

                window.SetOptionValue(ReplOptions.UseSmartUpDown, PythonToolsPackage.Instance.InteractiveOptionsPage.GetOptions(factory).ReplSmartHistory);
            }
            return(window);
        }