Skip to content

Commit

Permalink
Ticket #216: Proper floor division in CLI
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.
  • Loading branch information
Aurelien Degremont authored and Aurelien Degremont committed Jul 25, 2024
1 parent 4e85185 commit a820033
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 a820033

Please sign in to comment.