Files @ 6c485794f10e
Branch filter:

Location: kallithea/rhodecode/lib/dbmigrate/migrate/versioning/cfgparse.py

Bradley M. Kuhn
Translation updates from RhodeCode v2.2.5
Includes a new German translation.

These are licensed under GPLv3, for various reasons, including since they
include textual copies of strings from the GPLv3'd Python and HTML files.
"""
   Configuration parser module.
"""

from ConfigParser import ConfigParser

from rhodecode.lib.dbmigrate.migrate.versioning.config import *
from rhodecode.lib.dbmigrate.migrate.versioning import pathed


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)