All pastes #397643 Raw Edit

Someone

public python v1 · immutable
·published 2007-03-16 17:08 UTC
rendered paste body
#!/usr/bin/python# -*- coding: UTF-8 -*-#   # Copyright (c) 2006 Emencia## Authors:#           philippe lafaye <lafaye@emencia.com>#   # This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.#   # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.#   # You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.# $Id: __init__.py 1142 2007-03-15 15:59:39Z fantomas $from ConfigParser import SafeConfigParser__configuration = {}class Configuration(object):    """This class is use to join a lot of configuration file from       multi-package"""    def getdatas(self):        """return a copy of the dictionnary data"""        return __configuration.copy()    def addinfo(self,key,data):        """add info into the dictionnary"""        __configuration[key] = data    def get(self,key):        """return a configuration value"""        return __configuration[key]    def addconffile(self,path):        """add into the dictionnary a new configuration file"""        confparser = SafeConfigParser()