term_utils.py 文件源码

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

项目:walkdir-telegram-bot 作者: deepserket 项目源码 文件源码
def create_keyboard(self, window=0):
        self.files = self.ls()
        self.files.insert(0, [InlineKeyboardButton('OPEN TERMINAL HERE',
                                                           callback_data=' t')])
        if len(self.files) <= 52:
            return self.files

        start = 0 if window == 0 else window * 50
        stop = start + 50

        head = None if start == 0 else (InlineKeyboardButton("<<<PREVIOUS<<<",
                                          callback_data="{}w".format(window-1)))

        foot = None if stop > len(self.files) else (InlineKeyboardButton(">>>NEXT>>>",
                                          callback_data="{}w".format(window+1)))

        kb = build_menu(self.files[start:stop], header=head, footer=foot)
        return kb
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号