MessageBox.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:HTP 作者: nklose 项目源码 文件源码
def add_long_text(self, text):
        wrapper = textwrap.TextWrapper()
        wrapper.width = self.width - 4
        i = 0
        for line in wrapper.wrap(text):
            if len(line) == 0:
                self.blank_line()
            else:
                # get filler spaces
                spaces = ''
                i = self.width - len(line) - 4
                while i > 0:
                    spaces += ' '
                    i -= 1

                # add the line
                bordered_line = colored(u'\u2502 ', self.border_color)
                bordered_line += colored(line + spaces, self.text_color)
                bordered_line += colored(' ' + u'\u2502', self.border_color)
                self.text.append(bordered_line)

    # adds a line which may contain color tags
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号