aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/specification_parser.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-02-24 14:49:00 +0100
committerTibor Frank <tifrank@cisco.com>2020-03-13 19:52:35 +0100
commit0c3e94ed3f70c9dcd41e55ba2c043dd134aa7333 (patch)
tree34df9960131294c19b52cafee4ec3ff607c04b5b /resources/tools/presentation/specification_parser.py
parent3409f0d8c3c1b8c813043c44efb941c8fce51cad (diff)
PAL: Process local xml file
Change-Id: I2d60b2c6616de6d6b2e1d742407ac392471883aa Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/specification_parser.py')
-rw-r--r--resources/tools/presentation/specification_parser.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/resources/tools/presentation/specification_parser.py b/resources/tools/presentation/specification_parser.py
index d2939bb4c1..e3ad4f5387 100644
--- a/resources/tools/presentation/specification_parser.py
+++ b/resources/tools/presentation/specification_parser.py
@@ -135,6 +135,15 @@ class Specification:
"""
return self._specification[u"input"]
+ @input.setter
+ def input(self, new_value):
+ """Setter - specification - inputs.
+
+ :param new_value: New value to be set.
+ :type new_value: dict
+ """
+ self._specification[u"input"] = new_value
+
@property
def builds(self):
"""Getter - builds defined in specification.
@@ -144,6 +153,27 @@ class Specification:
"""
return self.input[u"builds"]
+ @builds.setter
+ def builds(self, new_value):
+ """Setter - builds defined in specification.
+
+ :param new_value: New value to be set.
+ :type new_value: dict
+ """
+ self.input[u"builds"] = new_value
+
+ def add_build(self, job, build):
+ """Add a build to the specification.
+
+ :param job: The job which run the build.
+ :param build: The build to be added.
+ :type job: str
+ :type build: dict
+ """
+ if self._specification[u"input"][u"builds"].get(job, None) is None:
+ self._specification[u"input"][u"builds"][job] = list()
+ self._specification[u"input"][u"builds"][job].append(build)
+
@property
def output(self):
"""Getter - specification - output formats and versions to be generated.