Mercurial > kallithea
comparison rhodecode/lib/dbmigrate/migrate/versioning/cfgparse.py @ 833:9753e0907827 beta
added dbmigrate package, added model changes
moved out upgrade db command to that package
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 11 Dec 2010 01:54:12 +0100 |
parents | |
children | 08d2dcd71666 |
comparison
equal
deleted
inserted
replaced
832:634596f81cfd | 833:9753e0907827 |
---|---|
1 """ | |
2 Configuration parser module. | |
3 """ | |
4 | |
5 from ConfigParser import ConfigParser | |
6 | |
7 from migrate.versioning.config import * | |
8 from migrate.versioning import pathed | |
9 | |
10 | |
11 class Parser(ConfigParser): | |
12 """A project configuration file.""" | |
13 | |
14 def to_dict(self, sections=None): | |
15 """It's easier to access config values like dictionaries""" | |
16 return self._sections | |
17 | |
18 | |
19 class Config(pathed.Pathed, Parser): | |
20 """Configuration class.""" | |
21 | |
22 def __init__(self, path, *p, **k): | |
23 """Confirm the config file exists; read it.""" | |
24 self.require_found(path) | |
25 pathed.Pathed.__init__(self, path) | |
26 Parser.__init__(self, *p, **k) | |
27 self.read(path) |