(self, std='', edit='', length=4)
return int(edit)
Method to get a number
Method to get a number
Method to get a number
def get_num(self, std='', edit='', length=4):
        '''Method to get a number'''

        edit = edit
        e = 60 # just an unrecognized letter
        while e != NL:
            if (e == cur.KEY_BACKSPACE or e == DEL) and len(edit) != 0:
                edit = edit[:-1]
            elif e == cur.KEY_BACKSPACE or e == DEL:
                pass
            elif e == 4:
                return -1
            elif e == cur.KEY_RESIZE:
                self.resize_all()
            elif e == cur.KEY_F5:
                return False
            elif len(edit) < length and e >= 48 and e <= 57:
                edit += chr(e)
            self.draw_text(False,
                           (1, 0, std + edit))
            try:
                e = self.stdscr.getch()
            except KeyboardInterrupt:
                e = 4
            if e == NL and edit == '':
                e = cur.KEY_BACKSPACE
                continue
        return int(edit)
def get_num ( self , std = '' , edit = '' , length = 4 ) : edit = edit e = 60 # just an unrecognized letter while e != NL : if ( e == cur . KEY_BACKSPACE or e == DEL ) and len ( edit ) != 0 : edit = edit [ : - 1 ] elif e == cur . KEY_BACKSPACE or e == DEL : pass elif e == 4 : return - 1 elif e == cur . KEY_RESIZE : self . resize_all ( ) elif e == cur . KEY_F5 : return False elif len ( edit ) < length and e >= 48 and e <= 57 : edit += chr ( e ) self . draw_text ( False , ( 1 , 0 , std + edit ) ) try : e = self . stdscr . getch ( ) except KeyboardInterrupt : e = 4 if e == NL and edit == '' : e = cur . KEY_BACKSPACE continue return int ( edit )