From cfbab5fe76f8011bc8b6b895b2d3bfff4ea167b3 Mon Sep 17 00:00:00 2001 From: Angelos Evripiotis Date: Tue, 2 Jul 2019 17:14:44 +0100 Subject: Refactor, use context.messenger directly Instead of having methods in Context forward calls on to the Messenger, have folks call the Messenger directly. Remove the forwarding methods in Context. --- src/buildstream/plugin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/buildstream/plugin.py') diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py index a12ff61ec..de969c267 100644 --- a/src/buildstream/plugin.py +++ b/src/buildstream/plugin.py @@ -657,10 +657,10 @@ class Plugin(): # This will raise SourceError on its own self.call(... command which takes time ...) """ - with self.__context.timed_activity(activity_name, - unique_id=self._unique_id, - detail=detail, - silent_nested=silent_nested): + with self.__context.messenger.timed_activity(activity_name, + unique_id=self._unique_id, + detail=detail, + silent_nested=silent_nested): yield def call(self, *popenargs, fail=None, fail_temporarily=False, **kwargs): @@ -798,7 +798,7 @@ class Plugin(): # @contextmanager def _output_file(self): - log = self.__context.get_log_handle() + log = self.__context.messenger.get_log_handle() if log is None: with open(os.devnull, "w") as output: yield output @@ -870,7 +870,7 @@ class Plugin(): def __message(self, message_type, brief, **kwargs): message = Message(self._unique_id, message_type, brief, **kwargs) - self.__context.message(message) + self.__context.messenger.message(message) def __note_command(self, output, *popenargs, **kwargs): workdir = kwargs.get('cwd', os.getcwd()) -- cgit v1.2.1