Beispiel #1
0
 def right_column_view(self) -> Any:
     self.users_view = RightColumnView(View.RIGHT_WIDTH, self)
     return urwid.LineBox(
         self.users_view, title=u"Users",
         tlcorner=u'━', tline=u'━', lline=u'',
         trcorner=u'━', blcorner=u'─', rline=u'',
         bline=u'', brcorner=u''
     )
Beispiel #2
0
 def right_column_view(self) -> Any:
     self.users_view = RightColumnView(View.RIGHT_WIDTH, self)
     return urwid.LineBox(self.users_view,
                          title="Users",
                          tlcorner=LIST_TITLE_BAR_LINE,
                          tline=LIST_TITLE_BAR_LINE,
                          trcorner=LIST_TITLE_BAR_LINE,
                          lline='',
                          blcorner='─',
                          rline='',
                          bline='',
                          brcorner='')
Beispiel #3
0
 def right_column_view(self) -> Any:
     self.users_view = RightColumnView(self)
     return urwid.LineBox(
         self.users_view,
         title="Users",
         title_attr="column_title",
         tlcorner=COLUMN_TITLE_BAR_LINE,
         tline=COLUMN_TITLE_BAR_LINE,
         trcorner=COLUMN_TITLE_BAR_LINE,
         lline="",
         blcorner="─",
         rline="",
         bline="",
         brcorner="",
     )
Beispiel #4
0
    def test_users_view(self, mocker):
        self.view.users = [{'user_id': 1, 'status': 'active'}]
        self.view.model.unread_counts.get.return_value = 1
        user_btn = mocker.patch(VIEWS + ".UserButton")
        mocker.patch(VIEWS + ".UsersView")
        list_w = mocker.patch(VIEWS + ".urwid.SimpleFocusListWalker")

        right_col_view = RightColumnView(self.view)

        right_col_view.view.model.unread_counts.get.assert_called_once_with(
            1, 0)
        user_btn.assert_called_once_with(self.view.users[0],
                                         controller=self.view.controller,
                                         view=self.view,
                                         color=self.view.users[0]['status'],
                                         count=1)
        list_w.assert_called_once_with(right_col_view.users_btn_list)
Beispiel #5
0
 def right_column_view(self) -> Any:
     tab = TabView(
         f"{AUTOHIDE_TAB_RIGHT_ARROW} USERS {AUTOHIDE_TAB_RIGHT_ARROW}")
     self.users_view = RightColumnView(self)
     panel = urwid.LineBox(
         self.users_view,
         title="Users",
         title_attr="column_title",
         tlcorner=COLUMN_TITLE_BAR_LINE,
         tline=COLUMN_TITLE_BAR_LINE,
         trcorner=COLUMN_TITLE_BAR_LINE,
         lline="",
         blcorner="─",
         rline="",
         bline="",
         brcorner="",
     )
     return panel, tab
Beispiel #6
0
 def right_col_view(self, mocker):
     mocker.patch(VIEWS + ".RightColumnView.users_view")
     return RightColumnView(self.view)
Beispiel #7
0
 def right_column_view(self) -> Any:
     self.users_view = RightColumnView(self)
     w = urwid.LineBox(self.users_view, title=u"Users")
     return w