~ubuntu-branches/ubuntu/quantal/griffith/quantal

« back to all changes in this revision

Viewing changes to lib/config.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2011-12-18 21:15:25 UTC
  • mfrom: (1.1.17) (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111218211525-endbgt82m3jh9gde
Tags: 0.13-1
* New upstream release
* VCS-* fields removed (berlios will be shutdown)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: UTF-8 -*-
2
2
 
3
 
__revision__ = '$Id: config.py 1457 2010-10-03 18:38:47Z piotrek $'
 
3
__revision__ = '$Id: config.py 1502 2011-01-19 15:52:19Z mikej06 $'
4
4
 
5
 
# Copyright © 2005-2009 Vasco Nunes, Piotr Ożarowski
 
5
# Copyright © 2005-2011 Vasco Nunes, Piotr Ożarowski
6
6
#
7
7
# This program is free software; you can redistribute it and/or modify
8
8
# it under the terms of the GNU General Public License as published by
44
44
            return default
45
45
        else:
46
46
            value = self._cfg.get(section, option, False)
 
47
            value = value.replace('%%', '%')
47
48
            value = Config.subst.get(value, value) # replace 'True' etc.
48
49
            return value
49
50
 
54
55
            value = str(value)
55
56
        if not self._cfg.has_section(section):
56
57
            self._cfg.add_section(section)
 
58
        value = value.replace('%', '%%')
57
59
        self._cfg.set(section, option, value)
58
60
 
59
61
    def has_key(self, key, section='main'):