Commit c1af6815 authored by Fred Drake's avatar Fred Drake

- add a name attribute to the openers

- docstrings
parent 6549edcb
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Open database and storage from a configuration. """Open database and storage from a configuration.
$Id: config.py,v 1.5 2003/01/07 23:28:14 fdrake Exp $""" $Id: config.py,v 1.6 2003/01/09 18:26:53 fdrake Exp $"""
import os import os
import StringIO import StringIO
...@@ -51,10 +51,24 @@ def databaseFromConfig(config): ...@@ -51,10 +51,24 @@ def databaseFromConfig(config):
class StorageConfig: class StorageConfig:
"""Object representing a configured storage.
Methods:
open() -- open and return the storage object
Attributes:
name -- name of the storage
"""
def __init__(self, config): def __init__(self, config):
self.config = config self.config = config
self.name = config.getSectionName()
def open(self): def open(self):
"""Open and return the storage object."""
raise NotImplementedError raise NotImplementedError
class MappingStorage(StorageConfig): class MappingStorage(StorageConfig):
......
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