Package gensaschema :: Module _config :: Class Config
[frames] | no frames]

Class Config

source code

object --+
         |
        Config

Schema config container
Instance Methods
 
__init__(self, tables, schemas, lines=None)
Initialization
source code
 
dump(self, fp)
Dump config to a file
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
Config
from_file(cls, name_or_file)
Construct from config file
source code
Config
from_lines(cls, lines)
Create from config lines
source code
Config
from_parser(cls, parser, lines=None)
Construct from config parser
source code
Instance Variables
list tables
Table list
Properties

Inherited from object: __class__

Method Details

__init__(self, tables, schemas, lines=None)
(Constructor)

source code 
Initialization
Parameters:
  • tables (list) - Table list
  • schemas (dict) - (Alien) Schema mapping
  • lines (sequence) - Original config lines. If omitted or None, the config lines are not available.
Overrides: object.__init__

from_file(cls, name_or_file)
Class Method

source code 
Construct from config file
Parameters:
  • name_or_file (str or file) - Config filename or file pointer
Returns: Config
New Config instance
Raises:
  • IOError - Error reading the file (except for ENOENT, which treats the file as empty)

from_lines(cls, lines)
Class Method

source code 
Create from config lines
Parameters:
  • lines (sequence) - List of config lines
Returns: Config
New Config instance

from_parser(cls, parser, lines=None)
Class Method

source code 
Construct from config parser
Parameters:
  • parser (ConfigParser.RawConfigParser) - Configparser instance
  • lines (sequence) - Original config lines
Returns: Config
New Config instance

dump(self, fp)

source code 
Dump config to a file
Parameters:
  • fp (file) - Stream to dump to

Instance Variable Details

tables

Table list
Type:
list