Logo Search packages:      
Sourcecode: lfm version File versions  Download package

def lfm::lfm::Panel::show (   self  ) 

show panel

Definition at line 319 of file lfm.py.

00319                   :
        """show panel"""

        # invisible
        if self.pos == 0:
            return

        self.win_files.erase()
        if self.maxw < 65:
            return
        # headers
        if self.pos != 3:
            if self == app.panels[app.panel]:
                self.win_files.attrset(curses.color_pair(5))
                attr = curses.color_pair(6) | curses.A_BOLD
            else:
                self.win_files.attrset(curses.color_pair(2))
                attr = curses.color_pair(2)
            if not self.vfs:
                path = self.path
            else:
                path = vfs.join(app, self)
            if len(path) > int(self.maxw/2) - 5:
                title_path = '~' + path[-int(self.maxw/2)+5:]
            else:
                title_path = path
            self.win_files.box()
 
            self.win_files.addstr(0, 2, title_path, attr)
            self.win_files.addstr(1, 1, center('Name', self.pos_col1-2),
                                  curses.color_pair(2) | curses.A_BOLD)
            self.win_files.addstr(1, self.pos_col1 + 2, 'Size',
                                  curses.color_pair(2) | curses.A_BOLD)
            self.win_files.addstr(1, self.pos_col2 + 5, 'Date',
                                  curses.color_pair(2) | curses.A_BOLD)

        # files
        for i in range(self.file_z - self.file_a + 1):
            filename = self.sorted[i + self.file_a]
            try:
                self.selections.index(filename)
            except ValueError:
                attr = curses.color_pair(2)
            else:
                attr = curses.color_pair(10) | curses.A_BOLD
            # get file info
            res = files.get_fileinfo_dict(self.path, filename,
                                          self.files[filename])
            # full panel
            if self.pos == 3:
                buf = self.__get_fileinfo_str_long(res)
                self.win_files.addstr(i, 0, buf, attr)
            # left or right panels
            else:
                buf = self.__get_fileinfo_str_short(res)
                self.win_files.addstr(i + 2, 1, buf, attr)

        # vertical separators
        if self.pos != 3:
            self.win_files.vline(1, self.pos_col1,
                                 curses.ACS_VLINE, self.dims[0]-2)
            self.win_files.vline(1, self.pos_col2,
                                 curses.ACS_VLINE, self.dims[0]-2)

        # vertical scroll bar
        if self.pos != 0:
            if self.pos == 3:
                h = self.maxh - 2
            else:
                h = self.maxh - 5
            y0, n = calculate_scrollbar_dims(h, self.nfiles, self.file_i)
            if self.pos == 3:
                if n != 0:
                    self.win_files.vline(0, self.maxw - 1,
                                         curses.ACS_VLINE, h)
                self.win_files.vline(y0, self.maxw - 1, curses.ACS_CKBOARD, n)
                if self.file_a != 0:
                    self.win_files.vline(0, self.maxw - 1, '^', 1)
                    if n == 1 and (y0 == 0):
                        self.win_files.vline(1, self.maxw - 1,
                                             curses.ACS_CKBOARD, n)
                if self.nfiles - 1 > self.file_a + h - 1:
                    self.win_files.vline(h - 1, self.maxw - 1, 'v', 1)
                    if n == 1 and (y0 == h - 1):
                        self.win_files.vline(h - 2, self.maxw - 1,
                                             curses.ACS_CKBOARD, n)
            else:
                self.win_files.vline(y0 + 2, int(self.maxw/2) - 1,
                                     curses.ACS_CKBOARD, n)
                if self.file_a != 0:
                    self.win_files.vline(2, int(self.maxw/2) - 1, '^', 1)
                    if n == 1 and (y0 + 2 == 2):
                        self.win_files.vline(3, int(self.maxw/2) - 1,
                                             curses.ACS_CKBOARD, n)
                if self.nfiles - 1 > self.file_a + h - 1:
                    self.win_files.vline(h + 1, int(self.maxw/2) - 1, 'v', 1)
                    if n == 1 and (y0 + 2 == h + 1):
                        self.win_files.vline(h, int(self.maxw/2) - 1,
                                             curses.ACS_CKBOARD, n)

        self.win_files.refresh()
        self.__showbar()


    def __showbar(self):


Generated by  Doxygen 1.6.0   Back to index