jan.dittberner 5289c4df3b migrate.versioning PEP-8 improvements, more documentation
- made api.py, cfgparse.py, exceptions.py, genmodel.py,
  migrate_repository.py, and pathed.py PEP-8 clean
- add tools.rst documenting the usage of migrate_repository.py
- add more modules to api.rst
- reference tools.rst from index.rst
2009-01-25 21:08:33 +00:00

27 lines
666 B
Python

"""
Configuration parser module.
"""
from migrate.versioning.base import *
from migrate.versioning import pathed
from ConfigParser import ConfigParser
class Parser(ConfigParser):
"""A project configuration file."""
def to_dict(self, sections=None):
"""It's easier to access config values like dictionaries"""
return self._sections
class Config(pathed.Pathed, Parser):
"""Configuration class."""
def __init__(self, path, *p, **k):
"""Confirm the config file exists; read it."""
self.require_found(path)
pathed.Pathed.__init__(self, path)
Parser.__init__(self, *p, **k)
self.read(path)