Home | Trees | Indices | Help |
---|
|
1 # 2 # Flies Python Client 3 # 4 # Copyright (c) 2010 Jian Ni <jni@redhat.com> 5 # Copyright (c) 2010 Red Hat, Inc. 6 # 7 # This library is free software; you can redistribute it and/or 8 # modify it under the terms of the GNU Lesser General Public 9 # License as published by the Free Software Foundation; either 10 # version 2 of the License, or (at your option) any later version. 11 # 12 # This library is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU Lesser General Public License for more details. 16 # 17 # You should have received a copy of the GNU Lesser General Public 18 # License along with this program; if not, write to the 19 # Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 # Boston, MA 02111-1307 USA 21 22 __all__ = ( 23 "FliesConfig", 24 ) 25 26 import ConfigParser 27 import os.path 284831 projectconfig = "./.fliesrc" 32 userconfig = "~/.fliesrc" 33 self.configparser = ConfigParser.ConfigParser() 34 self._config = self.configparser.read([projectconfig, os.path.expanduser(userconfig)])3537 if self._config: 38 try: 39 value = self.configparser.get(section, name) 40 return value 41 except ConfigParser.NoOptionError, NoSectionError: 42 return default_value 43 else: 44 return default_value45
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Sep 2 01:12:24 2010 | http://epydoc.sourceforge.net |