(self)
Display help text popup window.
Display help text popup window.
Display help text popup window .
def help(self):
        """Display help text popup window.

        """
        help_txt = """
        Save and exit                               : F2 or Ctrl-x
                                       (Enter if single-line entry)
        Exit without saving                         : F5 or ESC
        Cursor movement                             : Arrow keys
        Move to beginning of line                   : Home
        Move to end of line                         : End
        Page Up/Page Down                           : PgUp/PgDn
        Backspace/Delete one char left of cursor    : Backspace
        Delete 1 char under cursor                  : Del
        Insert line at cursor                       : Enter
        Delete to end of line                       : Ctrl-k
        Delete to beginning of line                 : Ctrl-u
        Help                                        : F1
        """
        try:
            curses.curs_set(0)
        except:
            pass
        txt = help_txt.split('\n')
        lines = min(self.max_win_size_y, len(txt) + 2)
        cols = min(self.max_win_size_x, max([len(i) for i in txt]) + 2)
        # Only print help text if the window is big enough
        try:
            popup = curses.newwin(lines, cols, 0, 0)
            popup.addstr(1, 1, help_txt)
            popup.box()
        except:
            pass
        else:
            while not popup.getch():
                pass
        finally:
            # Turn back on the cursor
            if self.pw_mode is False:
                curses.curs_set(1)
            # flushinp Needed to prevent spurious F1 characters being written to line
            curses.flushinp()
            self.box_init()
def help ( self ) : help_txt = """
        Save and exit                               : F2 or Ctrl-x
                                       (Enter if single-line entry)
        Exit without saving                         : F5 or ESC
        Cursor movement                             : Arrow keys
        Move to beginning of line                   : Home
        Move to end of line                         : End
        Page Up/Page Down                           : PgUp/PgDn
        Backspace/Delete one char left of cursor    : Backspace
        Delete 1 char under cursor                  : Del
        Insert line at cursor                       : Enter
        Delete to end of line                       : Ctrl-k
        Delete to beginning of line                 : Ctrl-u
        Help                                        : F1
        """ try : curses . curs_set ( 0 ) except : pass txt = help_txt . split ( '\n' ) lines = min ( self . max_win_size_y , len ( txt ) + 2 ) cols = min ( self . max_win_size_x , max ( [ len ( i ) for i in txt ] ) + 2 ) # Only print help text if the window is big enough try : popup = curses . newwin ( lines , cols , 0 , 0 ) popup . addstr ( 1 , 1 , help_txt ) popup . box ( ) except : pass else : while not popup . getch ( ) : pass finally : # Turn back on the cursor if self . pw_mode is False : curses . curs_set ( 1 ) # flushinp Needed to prevent spurious F1 characters being written to line curses . flushinp ( ) self . box_init ( )