Esempio n. 1
0
        public override void LoadSettingsFromStorage()
        {
            var interpreterService = ComponentModel.GetService <IInterpreterOptionsService>();

            var seenIds      = new HashSet <Guid>();
            var placeholders = PyService.InteractiveOptions.Where(kv => kv.Key is InterpreterPlaceholder).ToArray();

            PyService.ClearInteractiveOptions();
            foreach (var interpreter in interpreterService.Interpreters)
            {
                seenIds.Add(interpreter.Id);
                PyService.GetInteractiveOptions(interpreter);
            }

            foreach (var kv in placeholders)
            {
                if (!seenIds.Contains(kv.Key.Id))
                {
                    PyService.AddInteractiveOptions(kv.Key, kv.Value);
                }
            }

            if (_window != null)
            {
                _window.UpdateInterpreters();
            }
        }
        public override void LoadSettingsFromStorage()
        {
            var interpreterService = ComponentModel.GetService <IInterpreterRegistryService>();

            var seenIds      = new HashSet <string>();
            var placeholders = PyService.InteractiveOptions.Where(kv => kv.Key.StartsWith(InterpreterPlaceholder.PlaceholderId + ";")).ToArray();

            PyService.ClearInteractiveOptions();
            foreach (var interpreter in interpreterService.Interpreters)
            {
                seenIds.Add(interpreter.Configuration.Id);
                PyService.GetInteractiveOptions(interpreter.Configuration);
            }

            foreach (var kv in placeholders)
            {
                if (!seenIds.Contains(kv.Key))
                {
                    PyService.AddInteractiveOptions(kv.Key, kv.Value);
                }
            }

            if (_window != null)
            {
                _window.UpdateInterpreters();
            }
        }
Esempio n. 3
0
 public PythonInteractiveOptions GetOptions(IPythonInterpreterFactory interpreterFactory)
 {
     return(PyService.GetInteractiveOptions(interpreterFactory));
 }
Esempio n. 4
0
 private PythonInteractiveOptions ReadOptions(IPythonInterpreterFactory interpreter)
 {
     return(PyService.GetInteractiveOptions(interpreter));
 }