Github user mxmrlv commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/207#discussion_r150774520
--- Diff: aria/parser/consumption/presentation.py ---
@@ -31,47 +32,33 @@ class Read(Consumer):
instances.
It supports agnostic raw data composition for presenters that have
- ``_get_import_locations`` and ``_merge_import``.
+ ``_get_import_locations``, ``_validate_import``, and ``_merge_import``.
To improve performance, loaders are called asynchronously on separate
threads.
Note that parsing may internally trigger more than one
loading/reading/presentation
cycle, for example if the agnostic raw data has dependencies that must
also be parsed.
"""
- def consume(self):
- if self.context.presentation.location is None:
- self.context.validation.report('Presentation consumer: missing
location')
- return
-
- presenter = None
- imported_presentations = None
+ def __init__(self, context):
+ super(Read, self).__init__(context)
+ self._cache = {}
- executor =
FixedThreadPoolExecutor(size=self.context.presentation.threads,
-
timeout=self.context.presentation.timeout)
- executor.print_exceptions =
self.context.presentation.print_exceptions
- try:
- presenter = self._present(self.context.presentation.location,
None, None, executor)
- executor.drain()
-
- # Handle exceptions
- for e in executor.exceptions:
- self._handle_exception(e)
+ def consume(self):
+ # Present the main location and all imports recursively
+ main, results = self._present_all()
--- End diff --
what does `main` and 'results' stand for? `main_service_template` and
`imported_service_templates`? It's not really clear
---