public CPythonInterpreter(PythonInterpreterFactoryWithDatabase factory) { _langVersion = factory.Configuration.Version; _factory = factory; _typeDb = _factory.GetCurrentDatabase(); _factory.NewDatabaseAvailable += OnNewDatabaseAvailable; }
public static PythonInterpreterFactoryWithDatabase CreateFromDatabase(Version version, params string[] dbPath) { var defPath = dbPath.ElementAtOrDefault(0) ?? PythonTypeDatabase.BaselineDatabasePath; var fact = new PythonInterpreterFactoryWithDatabase( new InterpreterConfiguration($"AnalysisOnly|{version}", $"Analysis Only {version}", version: version, uiMode: InterpreterUIMode.SupportsDatabase), new InterpreterFactoryCreationOptions { DatabasePath = defPath, WatchFileSystem = false } ); foreach (var p in dbPath.Skip(1)) { fact.GetCurrentDatabase().LoadDatabase(p); } return fact; }