Skip to content

Commit

Permalink
Ticket #216: Proper floor division in CLI (#221)
Browse files Browse the repository at this point in the history
In Shine.CLI.Display, use proper floor division with //
which is compatible with py2 and py3. We want a int here.

Co-authored-by: Aurelien Degremont <[email protected]>
  • Loading branch information
degremont and Aurelien Degremont authored Jul 25, 2024
1 parent e3e5be4 commit e5b2611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Shine/CLI/TextTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _str_title(self):
"""Build a title string"""
width = len(self._str_common(self._header).rstrip())
title = " %s " % self.title
right = max((width - len(title)) / 2, 1)
right = max((width - len(title)) // 2, 1)
left = max(width - len(title) - right, 1)
if self.color:
title = "%s%s%s" % (COLORS['header'], title, COLORS['stop'])
Expand Down

0 comments on commit e5b2611

Please sign in to comment.