[Notes] [Git][BuildStream/buildstream][Qinusty/message-helpers] fixup! Overhaul internal messaging API



Title: GitLab

Tristan Maat pushed to branch Qinusty/message-helpers at BuildStream / buildstream

Commits:

4 changed files:

Changes:

  • buildstream/_context.py
    ... ... @@ -364,7 +364,6 @@ class Context():
    364 364
             assert self._message_handler
    
    365 365
     
    
    366 366
             self._message_handler(message, context=self)
    
    367
    -        return
    
    368 367
     
    
    369 368
         # message():
    
    370 369
         #
    
    ... ... @@ -492,7 +491,7 @@ class Context():
    492 491
                 try:
    
    493 492
                     # Push activity depth for status messages
    
    494 493
                     self.message(activity_name, detail=detail, plugin=unique_id,
    
    495
    -                              msg_type=MessageType.START)
    
    494
    +                             msg_type=MessageType.START)
    
    496 495
                     self._push_message_depth(silent_nested)
    
    497 496
                     yield
    
    498 497
     
    
    ... ... @@ -502,14 +501,14 @@ class Context():
    502 501
                     elapsed = datetime.datetime.now() - starttime
    
    503 502
                     self._pop_message_depth()
    
    504 503
                     self.message(activity_name, detail=detail, elapsed=elapsed, plugin=unique_id,
    
    505
    -                              msg_type=MessageType.FAIL)
    
    504
    +                             msg_type=MessageType.FAIL)
    
    506 505
                     raise
    
    507 506
     
    
    508 507
                 elapsed = datetime.datetime.now() - starttime
    
    509 508
                 self._pop_message_depth()
    
    510 509
                 self.message(activity_name, detail=detail,
    
    511
    -                          elapsed=elapsed, plugin=unique_id,
    
    512
    -                          msg_type=MessageType.SUCCESS)
    
    510
    +                         elapsed=elapsed, plugin=unique_id,
    
    511
    +                         msg_type=MessageType.SUCCESS)
    
    513 512
     
    
    514 513
         # recorded_messages()
    
    515 514
         #
    

  • buildstream/_frontend/app.py
    ... ... @@ -35,7 +35,7 @@ from .._context import Context
    35 35
     from .._platform import Platform
    
    36 36
     from .._project import Project
    
    37 37
     from .._exceptions import BstError, StreamError, LoadError, LoadErrorReason, AppError
    
    38
    -from .._message import Message, MessageType, unconditional_messages
    
    38
    +from .._message import MessageType, unconditional_messages
    
    39 39
     from .._stream import Stream
    
    40 40
     from .._versions import BST_FORMAT_VERSION
    
    41 41
     from .. import _yaml
    

  • buildstream/_scheduler/jobs/job.py
    ... ... @@ -428,8 +428,7 @@ class Job():
    428 428
                     result = self.child_process()
    
    429 429
                 except SkipJob as e:
    
    430 430
                     elapsed = datetime.datetime.now() - starttime
    
    431
    -                self.message(MessageType.SKIPPED, str(e),
    
    432
    -                             elapsed=elapsed, logfile=filename)
    
    431
    +                self._context.skipped(e, elapsed=elapsed, logfile=filename)
    
    433 432
     
    
    434 433
                     # Alert parent of skip by return code
    
    435 434
                     self._child_shutdown(RC_SKIPPED)
    

  • buildstream/_stream.py
    ... ... @@ -30,7 +30,6 @@ from contextlib import contextmanager
    30 30
     from tempfile import TemporaryDirectory
    
    31 31
     
    
    32 32
     from ._exceptions import StreamError, ImplError, BstError, set_last_task_error
    
    33
    -from ._message import MessageType
    
    34 33
     from ._scheduler import Scheduler, SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue
    
    35 34
     from ._pipeline import Pipeline, PipelineSelection
    
    36 35
     from . import utils, _yaml, _site
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]