main.py 文件源码

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

项目:Discurses 作者: topisani 项目源码 文件源码
def __init__(self, discord_client):
        self.discord = discord_client
        self.tabs = {}
        self.w_tabs = TabSelector(self)
        self.frame = urwid.Frame(
            urwid.Filler(
                urwid.Text(
                    "????????????????????????????????????\n"
                    "????????????????????????????????????\n"
                    "????????????????????????????????????\n"
                    "                              v0.2.4\n"
                    "                                    \n"
                    "                                    \n"
                    " < Logging in... Hang tight! >      \n"
                    "  ---------------------------       \n"
                    "         \   ^__^                   \n"
                    "          \  (oo)\_______           \n"
                    "             (__)\       )\/\       \n"
                    "                 ||----w |          \n"
                    "                 ||     ||          \n"
                    "                                    \n"
                    "                                    \n"
                    "                                    \n",
                    align=urwid.CENTER)),
            header=self.w_tabs)

        HasModal.__init__(self, self.frame)

        self.urwid_loop = urwid.MainLoop(
            self.w_placeholder,
            palette=MainUI.palette,
            unhandled_input=lambda key: self._keypress(None, key),
            event_loop=urwid.AsyncioEventLoop(loop=self.discord.loop),
            pop_ups=True)

        def refresh(_loop, _data):
            _loop.draw_screen()
            _loop.set_alarm_in(2, refresh)

        self.urwid_loop.set_alarm_in(0.2, refresh)

        self.urwid_loop.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号