aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-09-13 21:35:45 -0400
committerTom Rini <trini@konsulko.com>2017-09-13 21:35:45 -0400
commitb861c61698fecd199c621a20059dff07017f8e33 (patch)
treebbc556146f917650d9e4c318a84339be93790352
parente333083bf36f347ddd14d3e91a0f3c2e9038180b (diff)
parentad8931400b193f701a415e7f69f1ad454d1b0380 (diff)
downloadu-boot-b861c61698fecd199c621a20059dff07017f8e33.zip
u-boot-b861c61698fecd199c621a20059dff07017f8e33.tar.gz
u-boot-b861c61698fecd199c621a20059dff07017f8e33.tar.bz2
Merge git://git.denx.de/u-boot-dm
-rw-r--r--tools/patman/settings.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index d735ff9..92379b7 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -212,7 +212,12 @@ def CreatePatmanConfigFile(config_fname):
print("Couldn't create patman config file\n")
raise
- print("[alias]\nme: %s <%s>" % (name, email), file=f)
+ print('''[alias]
+me: %s <%s>
+
+[bounces]
+nxp = Zhikang Zhang <zhikang.zhang@nxp.com>
+''' % (name, email), file=f)
f.close();
def _UpdateDefaults(parser, config):
@@ -282,6 +287,23 @@ def _ReadBouncesFile(fname):
continue
bounces.add(line.strip())
+def GetItems(config, section):
+ """Get the items from a section of the config.
+
+ Args:
+ config: _ProjectConfigParser object containing settings
+ section: name of section to retrieve
+
+ Returns:
+ List of (name, value) tuples for the section
+ """
+ try:
+ return config.items(section)
+ except ConfigParser.NoSectionError as e:
+ return []
+ except:
+ raise
+
def Setup(parser, project_name, config_fname=''):
"""Set up the settings module by reading config files.
@@ -303,11 +325,11 @@ def Setup(parser, project_name, config_fname=''):
config.read(config_fname)
- for name, value in config.items('alias'):
+ for name, value in GetItems(config, 'alias'):
alias[name] = value.split(',')
_ReadBouncesFile('doc/bounces')
- for name, value in config.items('bounces'):
+ for name, value in GetItems(config, 'bounces'):
bounces.add(value)
_UpdateDefaults(parser, config)