diff options
Diffstat (limited to 'buildstream/_frontend/app.py')
| -rw-r--r-- | buildstream/_frontend/app.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index 4675b0eb0..217225d82 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -34,6 +34,7 @@ from .. import Scope # Import various buildstream internals from .._context import Context +from .._platform import Platform from .._project import Project from .._exceptions import BstError, StreamError, LoadError, LoadErrorReason, AppError from .._message import Message, MessageType, unconditional_messages @@ -66,6 +67,7 @@ class App(): self.context = None # The Context object self.stream = None # The Stream object self.project = None # The toplevel Project object + self.loader = None self.logger = None # The LogLine object self.interactive = None # Whether we are running in interactive mode self.colors = None # Whether to use colors in logging @@ -198,11 +200,26 @@ class App(): if option_value is not None: setattr(self.context, context_attr, option_value) + Platform.create_instance(self.context) + + # Create the logger right before setting the message handler + self.logger = LogLine(self.context, + self._content_profile, + self._format_profile, + self._success_profile, + self._error_profile, + self._detail_profile, + indent=INDENT) + + # Propagate pipeline feedback to the user + self.context.set_message_handler(self._message_handler) + # # Load the Project # try: self.project = Project(directory, self.context, cli_options=self._main_options['option']) + self.loader = self.project.loader except LoadError as e: # Let's automatically start a `bst init` session in this case @@ -217,24 +234,13 @@ class App(): except BstError as e: self._error_exit(e, "Error loading project") - # Create the logger right before setting the message handler - self.logger = LogLine(self.context, - self._content_profile, - self._format_profile, - self._success_profile, - self._error_profile, - self._detail_profile, - indent=INDENT) - - # Propagate pipeline feedback to the user - self.context.set_message_handler(self._message_handler) - # Now that we have a logger and message handler, # we can override the global exception hook. sys.excepthook = self._global_exception_handler # Create the stream right away, we'll need to pass it around self.stream = Stream(self.context, self.project, self._session_start, + self.loader, session_start_callback=self.session_start_cb, interrupt_callback=self._interrupt_handler, ticker_callback=self._tick, |
