From 229b25d916c2bab22d935d688d2d397d49311a73 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 7 Apr 2021 13:12:41 +1000 Subject: [PATCH] Tools: param_parse: add *args and **kwargs to emitters --- Tools/autotest/param_metadata/ednemit.py | 3 ++- Tools/autotest/param_metadata/emit.py | 2 +- Tools/autotest/param_metadata/htmlemit.py | 4 ++-- Tools/autotest/param_metadata/jsonemit.py | 4 ++-- Tools/autotest/param_metadata/mdemit.py | 4 ++-- Tools/autotest/param_metadata/rstemit.py | 4 ++-- Tools/autotest/param_metadata/xmlemit.py | 4 ++-- Tools/autotest/param_metadata/xmlemit_mp.py | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Tools/autotest/param_metadata/ednemit.py b/Tools/autotest/param_metadata/ednemit.py index 5d253b7e2a..7523a038bd 100644 --- a/Tools/autotest/param_metadata/ednemit.py +++ b/Tools/autotest/param_metadata/ednemit.py @@ -11,7 +11,8 @@ import subprocess class EDNEmit(Emit): - def __init__(self): + def __init__(self, *args, **kwargs): + Emit.__init__(self, *args, **kwargs) self.output = "{:date " + edn_format.dumps(datetime.datetime.now(pytz.utc)) + " " git = subprocess.Popen(["git log --pretty=format:'%h' -n 1"], shell=True, stdout=subprocess.PIPE).communicate()[0] self.output += ":git-hash \"" + git.decode("ascii") + "\" " diff --git a/Tools/autotest/param_metadata/emit.py b/Tools/autotest/param_metadata/emit.py index dbba7cd991..82e21a78bb 100644 --- a/Tools/autotest/param_metadata/emit.py +++ b/Tools/autotest/param_metadata/emit.py @@ -7,7 +7,7 @@ import re class Emit: - def __init__(self): + def __init__(self, *args, **kwargs): pass prog_values_field = re.compile(r"\s*(-?\w+:\w+)+,*") diff --git a/Tools/autotest/param_metadata/htmlemit.py b/Tools/autotest/param_metadata/htmlemit.py index b0a76f858f..3e8f87b305 100644 --- a/Tools/autotest/param_metadata/htmlemit.py +++ b/Tools/autotest/param_metadata/htmlemit.py @@ -13,8 +13,8 @@ except Exception: class HtmlEmit(Emit): - def __init__(self): - Emit.__init__(self) + def __init__(self, *args, **kwargs): + Emit.__init__(self, *args, **kwargs) html_fname = 'Parameters.html' self.f = open(html_fname, mode='w') self.preamble = """