(self, *text)
Draw a help

        *text are arbitary string
Draw a help
Draw a help
def draw_help(self, *text):
        """Draw a help

        *text are arbitary string

        """

        if len(text) > self.ysize -1:
            length = self.ysize - 1
            offset = 0
            spill = len(text) - self.ysize + 2
        else:
            length = len(text)
            offset = 0
            spill = 0

        while True:
            try:
                self.draw_text(False)
                for i in range(length):
                    self.stdscr.addstr(
                    i + 1, 0, text[(i + offset)])
            except:
                pass
            finally:
                self.stdscr.refresh()
            try:
                e = self.stdscr.getch()
            except KeyboardInterrupt:
                e = 4

            if e == cur.KEY_DOWN:
                if offset < spill:
                    offset += 1
            elif e == cur.KEY_UP:
                if offset > 0:
                    offset -= 1
            elif e == NL:
                return
            elif e == cur.KEY_RESIZE:
                self.resize_all()
                if len(text) > self.ysize -1:
                    length = self.ysize - 1
                    offset = 0
                    spill = len(text) - self.ysize + 2
                else:
                    length = len(text)
                    offset = 0
                    spill = 0
            elif e == 4:
                if self.db is not None:
                    self.db.close()
                self.close()
def draw_help ( self , * text ) : if len ( text ) > self . ysize - 1 : length = self . ysize - 1 offset = 0 spill = len ( text ) - self . ysize + 2 else : length = len ( text ) offset = 0 spill = 0 while True : try : self . draw_text ( False ) for i in range ( length ) : self . stdscr . addstr ( i + 1 , 0 , text [ ( i + offset ) ] ) except : pass finally : self . stdscr . refresh ( ) try : e = self . stdscr . getch ( ) except KeyboardInterrupt : e = 4 if e == cur . KEY_DOWN : if offset < spill : offset += 1 elif e == cur . KEY_UP : if offset > 0 : offset -= 1 elif e == NL : return elif e == cur . KEY_RESIZE : self . resize_all ( ) if len ( text ) > self . ysize - 1 : length = self . ysize - 1 offset = 0 spill = len ( text ) - self . ysize + 2 else : length = len ( text ) offset = 0 spill = 0 elif e == 4 : if self . db is not None : self . db . close ( ) self . close ( )