mirror of https://github.com/nicolargo/glances.git
Remove a except in the main display function. Replace it by a test on the screen size.
This commit is contained in:
parent
1292150478
commit
d2bbcfed8d
|
|
@ -1059,8 +1059,7 @@ class _GlancesCurses(object):
|
|||
if not display_additional and m['additional']:
|
||||
continue
|
||||
# Is it possible to display the stat with the current screen size
|
||||
# !!! Crash if not try/except... Why ???
|
||||
try:
|
||||
if screen_x - x > 0:
|
||||
self.term_window.addnstr(
|
||||
y,
|
||||
x,
|
||||
|
|
@ -1069,21 +1068,18 @@ class _GlancesCurses(object):
|
|||
screen_x - x,
|
||||
self.colors_list[m['decoration']],
|
||||
)
|
||||
except Exception:
|
||||
# New column
|
||||
# Python 2: we need to decode to get real screen size because
|
||||
# UTF-8 special tree chars occupy several bytes.
|
||||
# Python 3: strings are strings and bytes are bytes, all is
|
||||
# good.
|
||||
try:
|
||||
x += len(u(m['msg']))
|
||||
except UnicodeDecodeError:
|
||||
# Quick and dirty hack for issue #745
|
||||
pass
|
||||
else:
|
||||
# New column
|
||||
# Python 2: we need to decode to get real screen size because
|
||||
# UTF-8 special tree chars occupy several bytes.
|
||||
# Python 3: strings are strings and bytes are bytes, all is
|
||||
# good.
|
||||
try:
|
||||
x += len(u(m['msg']))
|
||||
except UnicodeDecodeError:
|
||||
# Quick and dirty hack for issue #745
|
||||
pass
|
||||
if x > x_max:
|
||||
x_max = x
|
||||
if x > x_max:
|
||||
x_max = x
|
||||
|
||||
# Compute the next Glances column/line position
|
||||
self.next_column = max(self.next_column, x_max + self.space_between_column)
|
||||
|
|
|
|||
Loading…
Reference in New Issue