Commit 3005e976 authored by Chris McDonough's avatar Chris McDonough

Allow the support of multidatabase open calls.

parent 111916df
...@@ -86,13 +86,13 @@ class BaseConfig: ...@@ -86,13 +86,13 @@ class BaseConfig:
self.config = config self.config = config
self.name = config.getSectionName() self.name = config.getSectionName()
def open(self): def open(self, database_name='unnamed', databases=None):
"""Open and return the storage object.""" """Open and return the storage object."""
raise NotImplementedError raise NotImplementedError
class ZODBDatabase(BaseConfig): class ZODBDatabase(BaseConfig):
def open(self): def open(self, database_name='unnamed', databases=None):
section = self.config section = self.config
storage = section.storage.open() storage = section.storage.open()
try: try:
...@@ -100,7 +100,9 @@ class ZODBDatabase(BaseConfig): ...@@ -100,7 +100,9 @@ class ZODBDatabase(BaseConfig):
pool_size=section.pool_size, pool_size=section.pool_size,
cache_size=section.cache_size, cache_size=section.cache_size,
version_pool_size=section.version_pool_size, version_pool_size=section.version_pool_size,
version_cache_size=section.version_cache_size) version_cache_size=section.version_cache_size,
databases=databases,
database_name=database_name)
except: except:
storage.close() storage.close()
raise raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment