Add control if server did not return uptime stat

This commit is contained in:
Nicolas Hennion 2014-01-03 20:18:44 +01:00
parent 427d70340f
commit 0e5b73c12b

View File

@ -2626,9 +2626,13 @@ class glancesScreen:
center = ((screen_x - len(uptime_msg)) // 2) - len(system_msg) // 2
self.term_window.addnstr(self.system_y, self.system_x + center,
system_msg, 80, curses.A_UNDERLINE)
self.term_window.addnstr(self.uptime_y, screen_x - len(uptime_msg),
uptime_msg, 80)
return len(system_msg) + len(uptime_msg)
try:
self.term_window.addnstr(self.uptime_y, screen_x - len(uptime_msg),
uptime_msg, 80)
except:
return len(system_msg)
else:
return len(system_msg) + len(uptime_msg)
elif (screen_x > self.system_x + len(system_msg)):
center = (screen_x // 2) - len(system_msg) // 2
self.term_window.addnstr(self.system_y, self.system_x + center,