def init_popup(self, msg):
width = max([len(line) for line in msg.splitlines()] + [20])
height = msg.count('\n') + 4
cols, rows = os.get_terminal_size()
self.get_pop_up_parameters = lambda: dict(left=max(cols // 2 - width // 2, 1),
top=max(rows // 2 - height // 2, 1),
overlay_width=width,
overlay_height=height)
return self.open_pop_up()
评论列表
文章目录