X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fspecification_parser.py;h=e3ad4f5387343ebac456179ae7ecd24860c9962a;hb=e891f75dc1fb0897ff4a1798f1798ef760a4d395;hp=d2939bb4c1cc2f260ed027948e619a291dfa9568;hpb=691f24ec052cc9d48d6abe143bcae95486f94388;p=csit.git 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.