summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-07-19 11:56:03 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 08:41:12 +0100
commit21bb330f4632ae9e8dd9eaff2879bcd24f9cf194 (patch)
tree476a3ff0b5d7fc0f89fafc0cba2b720a6e6b5f3e /bitbake/lib/bb/event.py
parenteb7401d47087ba2347dcf780a0d07969bed4c072 (diff)
downloadpoky-21bb330f4632ae9e8dd9eaff2879bcd24f9cf194.tar.gz
bitbake: lib/bb/event: refactor printing events
We really ought to have just one place where the string representation of these events is produced. This doesn't take any real control away from the UI - if an alternative representation is desired, that can still be made. (Bitbake rev: cb15db2a799be6d8eab9a2a43a9a573f89229cff) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r--bitbake/lib/bb/event.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 92ee3e92d4..59cca61424 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -521,6 +521,28 @@ class NoProvider(Event):
521 def isRuntime(self): 521 def isRuntime(self):
522 return self._runtime 522 return self._runtime
523 523
524 def __str__(self):
525 msg = ''
526 if self._runtime:
527 r = "R"
528 else:
529 r = ""
530
531 extra = ''
532 if not self._reasons:
533 if self._close_matches:
534 extra = ". Close matches:\n %s" % '\n '.join(self._close_matches)
535
536 if self._dependees:
537 msg = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % (r, self._item, ", ".join(self._dependees), r, extra)
538 else:
539 msg = "Nothing %sPROVIDES '%s'%s" % (r, self._item, extra)
540 if self._reasons:
541 for reason in self._reasons:
542 msg += '\n' + reason
543 return msg
544
545
524class MultipleProviders(Event): 546class MultipleProviders(Event):
525 """Multiple Providers""" 547 """Multiple Providers"""
526 548
@@ -548,6 +570,16 @@ class MultipleProviders(Event):
548 """ 570 """
549 return self._candidates 571 return self._candidates
550 572
573 def __str__(self):
574 msg = "Multiple providers are available for %s%s (%s)" % (self._is_runtime and "runtime " or "",
575 self._item,
576 ", ".join(self._candidates))
577 rtime = ""
578 if self._is_runtime:
579 rtime = "R"
580 msg += "\nConsider defining a PREFERRED_%sPROVIDER entry to match %s" % (rtime, self._item)
581 return msg
582
551class ParseStarted(OperationStarted): 583class ParseStarted(OperationStarted):
552 """Recipe parsing for the runqueue has begun""" 584 """Recipe parsing for the runqueue has begun"""
553 def __init__(self, total): 585 def __init__(self, total):