Merge lp:~frankban/juju-quickstart/interactive-errors into lp:juju-quickstart
Proposed by
Francesco Banconi
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 102 | ||||
Proposed branch: | lp:~frankban/juju-quickstart/interactive-errors | ||||
Merge into: | lp:juju-quickstart | ||||
Diff against target: |
41 lines (+10/-2) 2 files modified
quickstart/cli/views.py (+7/-1) quickstart/tests/cli/test_views.py (+3/-1) |
||||
To merge this branch: | bzr merge lp:~frankban/juju-quickstart/interactive-errors | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+241276@code.launchpad.net |
Description of the change
Do not hide errors on interactive session.
To post a comment you must log in.
Reviewers: mp+241276_ code.launchpad. net,
Message:
Please take a look.
Description:
Do not hide errors on interactive session.
https:/ /code.launchpad .net/~frankban/ juju-quickstart /interactive- errors/ +merge/ 241276
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/166420044/
Affected files (+12, -2 lines): cli/views. py tests/cli/ test_views. py
A [revision details]
M quickstart/
M quickstart/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>
Index: quickstart/ cli/views. py cli/views. py' cli/views. py 2014-10-09 13:35:12 +0000 cli/views. py 2014-11-10 14:11:11 +0000
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -94,7 +94,10 @@
proposed solution to build multi-views CLI applications in Quickstart.
"""
-from __future__ import unicode_literals
+from __future__ import (
+ print_function,
+ unicode_literals,
+)
import copy
loop. run()
import functools
@@ -131,6 +134,9 @@
# Start the Urwid interactive session (main loop).
except ui.AppExit as err:
+ # The print below ensures the screen is properly refreshed when
+ # exiting the interactive session.
+ print('interactive session closed')
return err.return_value
Index: quickstart/ tests/cli/ test_views. py tests/cli/ test_views. py' tests/cli/ test_views. py 2014-10-10 08:54:46 +0000 tests/cli/ test_views. py 2014-11-10 14:11:11 +0000
run_ side_effect = ui.AppExit('bad wolf') setup_urwid_ app(run_ side_effect= run_side_ effect) :
self. assertEqual( 'bad wolf', return_value) assert_ called_ once_with( 'interactive session closed')
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -110,8 +110,10 @@
view = mock.Mock()
with self.patch_
- return_value = views.show(view)
+ with helpers.mock_print as mock_print:
+ return_value = views.show(view)
+ mock_print.
def test_view_ arguments( self):
# The view is invoked passing the app and all the optional show