SIGN IN SIGN UP

[bugfix] Port cache_output from compat

- compat had a cache_output functionality to fetch all async output during
  any input and print it afterwards. This feature is ported to core but in
  lowlevel userinterface.
- Add a RLock class to tools which works like RLock to enable nested
  locks but it also has a count property and a locked method.
- ui.output() redirects any output stream to a cache and flushes cache
  if output to terminal is not locked; cache is implemented as
  SimpleQueue
- ui.stream_output() outputs text to terminal
- ui.flush() outputs the cache entries to terminal via stream_output()
- register ui.flush() to be called at termination
- Add SimpleQueue to backports.py
- bot_choice.Option is an abstract base class now
- OutputOption got a new "out" property to be used inside ui.input_choice
- OutputProxyOption uses out property of passed output class
- update SequenceOutputter accordingly
- use color_format with ContextOption and HighlightContextOption
- update CatContextOption in category.py
- revert previous T73646 fix and use standard behaviour of BaseBot

Bug: T73646
Bug: T74942
Bug: T132135
Bug: T144698
Bug: T280466
Bug: T151727
Change-Id: I02d6b7a939a1912a4ebb8694af3e159d7dd7dae5
X
xqt committed
ce36af1b87dfabe819ec0057bdb09b91285d208d
Parent: b159ad1