diff options
author | Chris Packham <judge.packham@gmail.com> | 2017-09-01 20:57:53 +1200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-09-11 21:43:58 -0600 |
commit | e11aa602abd3e8007dfd3ed23ebb829101abcfec (patch) | |
tree | cfc1211c0b45c8185592b4354864e360774d2466 /tools/patman/settings.py | |
parent | c79d18c4b40d10c0a95b56e51f4517aca4515364 (diff) | |
download | u-boot-e11aa602abd3e8007dfd3ed23ebb829101abcfec.tar.gz |
patman: add support for omitting bouncing addresses
Add support for reading a list of bouncing addresses from a in-tree file
(doc/bounces) and from the ~/.patman config file. These addresses are
stripped from the Cc list.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com <mailto:philipp.tomsich@theobroma-systems.com>>
Diffstat (limited to 'tools/patman/settings.py')
-rw-r--r-- | tools/patman/settings.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 5f207f5ef1..d735ff9ba3 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -269,6 +269,19 @@ def _ReadAliasFile(fname): if bad_line: print(bad_line) +def _ReadBouncesFile(fname): + """Read in the bounces file if it exists + + Args: + fname: Filename to read. + """ + if os.path.exists(fname): + with open(fname) as fd: + for line in fd: + if line.startswith('#'): + continue + bounces.add(line.strip()) + def Setup(parser, project_name, config_fname=''): """Set up the settings module by reading config files. @@ -293,10 +306,15 @@ def Setup(parser, project_name, config_fname=''): for name, value in config.items('alias'): alias[name] = value.split(',') + _ReadBouncesFile('doc/bounces') + for name, value in config.items('bounces'): + bounces.add(value) + _UpdateDefaults(parser, config) # These are the aliases we understand, indexed by alias. Each member is a list. alias = {} +bounces = set() if __name__ == "__main__": import doctest |