def _width(self) -> int:
"""Get the number of columns to wrap text to.
This is either the width of the terminal window or the maximum width
set in the Formatter instance, whichever is smaller.
"""
if self.formatter.auto_width:
return min(
self.formatter.max_width, shutil.get_terminal_size().columns)
else:
return self.formatter.max_width
评论列表
文章目录