Skip to content

Commit bfdf899

Browse files
committed
refactor: Simplify separator_line() logic
1 parent e1e3ca9 commit bfdf899

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

glances/outputs/glances_curses.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -448,22 +448,14 @@ def separator_line(self, color='SEPARATOR'):
448448
if self.line >= 0:
449449
position = [self.line, self.column]
450450
line_color = self.colors_list[color]
451+
line_type = curses.ACS_HLINE if not self.args.disable_unicode else unicode_message('MEDIUM_LINE', self.args)
451452

452-
if not self.args.disable_unicode:
453-
# Use curses.ACS_HLINE for the separator line
454-
self.term_window.hline(
455-
*position,
456-
curses.ACS_HLINE,
457-
line_width,
458-
line_color,
459-
)
460-
else:
461-
self.term_window.addnstr(
462-
*position,
463-
unicode_message('MEDIUM_LINE', self.args) * line_width,
464-
line_width,
465-
line_color,
466-
)
453+
self.term_window.hline(
454+
*position,
455+
line_type,
456+
line_width,
457+
line_color,
458+
)
467459

468460
def __get_stat_display(self, stats, layer):
469461
"""Return a dict of dict with all the stats display.

0 commit comments

Comments
 (0)