public PythonTypeDatabase( PythonInterpreterFactoryWithDatabase factory, IEnumerable <string> databaseDirectories = null, PythonTypeDatabase innerDatabase = null ) { if (innerDatabase != null && factory.Configuration.Version != innerDatabase.LanguageVersion) { throw new InvalidOperationException("Language versions do not match"); } _factory = factory; if (innerDatabase != null) { _sharedState = new SharedDatabaseState(innerDatabase._sharedState); } else { _sharedState = new SharedDatabaseState(_factory.Configuration.Version); } if (databaseDirectories != null) { foreach (var d in databaseDirectories) { LoadDatabase(d); } } _sharedState.ListenForCorruptDatabase(this); }
internal SharedDatabaseState(SharedDatabaseState inner) { _inner = inner; _langVersion = _inner.LanguageVersion; if (_inner.BuiltinModule != null) { _builtinName = _inner.BuiltinModule.Name; } else { _builtinName = (_langVersion.Major == 3) ? BuiltinName3x : BuiltinName2x; } }
private PythonTypeDatabase( PythonInterpreterFactoryWithDatabase factory, string databaseDirectory, bool isDefaultDatabase ) { _factory = factory; _sharedState = new SharedDatabaseState( factory.Configuration.Version, databaseDirectory, defaultDatabase: isDefaultDatabase ); }
public PythonTypeDatabase( PythonInterpreterFactoryWithDatabase factory, IEnumerable<string> databaseDirectories = null, PythonTypeDatabase innerDatabase = null ) { if (innerDatabase != null && factory.Configuration.Version != innerDatabase.LanguageVersion) { throw new InvalidOperationException("Language versions do not match"); } _factory = factory; if (innerDatabase != null) { _sharedState = new SharedDatabaseState(innerDatabase._sharedState); } else { _sharedState = new SharedDatabaseState(_factory.Configuration.Version); } if (databaseDirectories != null) { foreach (var d in databaseDirectories) { LoadDatabase(d); } } _sharedState.ListenForCorruptDatabase(this); }