Simplify extracting the result from a WatchResult
This commit is contained in:
parent
8143992345
commit
e24d0a4659
1 changed files with 1 additions and 5 deletions
|
|
@ -412,16 +412,12 @@ class VariablesView( object ):
|
||||||
icon = '+' if ( watch.result.IsExpandable() and
|
icon = '+' if ( watch.result.IsExpandable() and
|
||||||
not watch.result.IsExpandedByUser() ) else '-'
|
not watch.result.IsExpandedByUser() ) else '-'
|
||||||
|
|
||||||
result_str = watch.result.result[ 'result' ]
|
|
||||||
if result_str is None:
|
|
||||||
result_str = '<unknown>'
|
|
||||||
|
|
||||||
line = '{indent}{marker}{icon} Result: {result}'.format(
|
line = '{indent}{marker}{icon} Result: {result}'.format(
|
||||||
# We borrow 1 space of indent to draw the change marker
|
# We borrow 1 space of indent to draw the change marker
|
||||||
indent = ' ' * ( indent - 1 ),
|
indent = ' ' * ( indent - 1 ),
|
||||||
marker = '*' if watch.result.changed else ' ',
|
marker = '*' if watch.result.changed else ' ',
|
||||||
icon = icon,
|
icon = icon,
|
||||||
result = result_str )
|
result = watch.result.result.get( 'result', '<unknown>' ) )
|
||||||
|
|
||||||
line = utils.AppendToBuffer( self._watch.win.buffer, line.split( '\n' ) )
|
line = utils.AppendToBuffer( self._watch.win.buffer, line.split( '\n' ) )
|
||||||
self._watch.lines[ line ] = watch.result
|
self._watch.lines[ line ] = watch.result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue