1 # Copyright (c) 2012 The Chromium OS Authors.
3 # See file CREDITS for list of people who contributed to this
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 """Set up the buildman settings module by reading config files
30 config_fname: Config filename to read ('' for default)
35 settings = ConfigParser.SafeConfigParser()
37 if config_fname == '':
38 config_fname = '%s/.buildman' % os.getenv('HOME')
40 settings.read(config_fname)
42 def GetItems(section):
43 """Get the items from a section of the config.
46 section: name of section to retrieve
49 List of (name, value) tuples for the section
52 return settings.items(section)
53 except ConfigParser.NoSectionError as e:
55 print ("Warning: No tool chains - please add a [toolchain] section "
56 "to your buildman config file %s. See README for details" %