aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2017-11-08 14:51:05 +0100
committerTibor Frank <tifrank@cisco.com>2017-11-08 13:54:22 +0000
commit982998f1565a303c981ea34e5ebcef67e872f810 (patch)
treef274fa4d788a86d61ce855e77ea04e8f075d124f
parent1af102ddfc5f787ca649d16ea4a27bb8f86cfde2 (diff)
PAL: Implement data sets for specification file.
Change-Id: I4a2d290a69700425f33caf7274c6fa525271e0c8 Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit 849e7756a138ff0b52767cb3cfea7aec9941ee91)
-rw-r--r--resources/tools/presentation/pal.py66
-rw-r--r--resources/tools/presentation/specification_parser.py4
2 files changed, 35 insertions, 35 deletions
diff --git a/resources/tools/presentation/pal.py b/resources/tools/presentation/pal.py
index fdd3e8a263..86b709c5be 100644
--- a/resources/tools/presentation/pal.py
+++ b/resources/tools/presentation/pal.py
@@ -83,39 +83,39 @@ def main():
logging.critical("Finished with error.")
sys.exit(1)
- # try:
- env = Environment(spec.environment, args.force)
- env.set_environment()
-
- if spec.is_debug:
- if spec.debug["input-format"] == "zip":
- unzip_files(spec)
- else:
- download_data_files(spec)
-
- prepare_static_content(spec)
-
- data = InputData(spec)
- data.read_data()
-
- generate_tables(spec, data)
- generate_plots(spec, data)
- generate_files(spec, data)
- generate_report(args.release, spec)
-
- logging.info("Successfully finished.")
-
- # except (KeyError, ValueError, PresentationError) as err:
- # logging.info("Finished with an error.")
- # logging.critical(str(err))
- # except Exception as err:
- # logging.info("Finished with an error.")
- # logging.critical(str(err))
- #
- # finally:
- # if spec is not None and not spec.is_debug:
- # clean_environment(spec.environment)
- # sys.exit(1)
+ try:
+ env = Environment(spec.environment, args.force)
+ env.set_environment()
+
+ if spec.is_debug:
+ if spec.debug["input-format"] == "zip":
+ unzip_files(spec)
+ else:
+ download_data_files(spec)
+
+ prepare_static_content(spec)
+
+ data = InputData(spec)
+ data.read_data()
+
+ generate_tables(spec, data)
+ generate_plots(spec, data)
+ generate_files(spec, data)
+ generate_report(args.release, spec)
+
+ logging.info("Successfully finished.")
+
+ except (KeyError, ValueError, PresentationError) as err:
+ logging.info("Finished with an error.")
+ logging.critical(str(err))
+ except Exception as err:
+ logging.info("Finished with an error.")
+ logging.critical(str(err))
+
+ finally:
+ if spec is not None and not spec.is_debug:
+ clean_environment(spec.environment)
+ sys.exit(1)
if __name__ == '__main__':
diff --git a/resources/tools/presentation/specification_parser.py b/resources/tools/presentation/specification_parser.py
index 7ee6dbb486..3404024a87 100644
--- a/resources/tools/presentation/specification_parser.py
+++ b/resources/tools/presentation/specification_parser.py
@@ -486,7 +486,7 @@ class Specification(object):
pass
# add data sets to the elements:
- if isinstance(element["data"], str):
+ if isinstance(element.get("data", None), str):
data_set = element["data"]
try:
element["data"] = self.configuration["data-sets"][data_set]
@@ -515,7 +515,7 @@ class Specification(object):
element["layout"].pop("layout")
try:
for key, val in (self.configuration["plot-layouts"]
- [layout]):
+ [layout].items()):
element["layout"][key] = val
except KeyError:
raise PresentationError("Layout {0} is not defined in "