tui: Make syntax 2.6 compatible

Two used features were unknown in 2.6:
- dict comprehensions
- nested with-statements

These syntax elements have been transformed to a 2.6 compatible syntax.

Change-Id: I0a5275f8eb1c5a111c366ea4782c45933f9b241c
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>