(self, *exp)
return (y, mon, d)
This method is used to get an expiration date for entries.

        exp is used to display an actual expiration date.
This method is used to get an expiration date for entries.
This method is used to get an expiration date for entries .
def get_manual_exp_date(self, *exp):
        '''This method is used to get an expiration date for entries.

        exp is used to display an actual expiration date.

        '''

        pass_y = False
        pass_mon = False
        goto_last = False
        while True:
            if pass_y is False:
                edit = ''
                e = cur.KEY_BACKSPACE
                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) < 4 and e >= 48 and e <= 57:
                        edit += chr(e)
                    self.draw_text(False,
                                   (1, 0, 'Special date 2999-12-28 means that '
                                    'the expires never.'),
                                   (3, 0, 'Year: ' + edit))
                    if exp:
                        try:
                            self.stdscr.addstr(2, 0,
                                               'Actual expiration date: ' +
                                               str(exp[0]) + '-' +
                                               str(exp[1]) + '-' +
                                               str(exp[2]))
                        except:
                            pass
                        finally:
                            self.stdscr.refresh()
                    try:
                        e = self.stdscr.getch()
                    except KeyboardInterrupt:
                        e = 4
                    if e == NL and edit == '':
                        e = cur.KEY_BACKSPACE
                        continue
                y = int(edit)
                pass_y = True

            if pass_mon is False:
                edit = ''
                e = cur.KEY_BACKSPACE
                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:
                        pass_y = False
                        goto_last = True
                        break
                    elif len(edit) < 2 and e >= 48 and e <= 57:
                        edit += chr(e)
                    self.draw_text(False,
                                   (1, 0, 'Special date 2999-12-28 means that '
                                    'the expires never.'),
                                   (3, 0, 'Year: ' + str(y)),
                                   (4, 0, 'Month: ' + edit))
                    if exp:
                        try:
                            self.stdscr.addstr(2, 0,
                                               'Actual expiration date: ' +
                                               str(exp[0]) + '-' +
                                               str(exp[1]) + '-' +
                                               str(exp[2]))
                        except:
                            pass
                        finally:
                            self.stdscr.refresh()
                    try:
                        e = self.stdscr.getch()
                    except KeyboardInterrupt:
                        e = 4

                    if e == NL and edit == '':
                        e = cur.KEY_BACKSPACE
                        continue
                    elif e == NL and (int(edit) > 12 or int(edit) < 1):
                        self.draw_text(False,
                                       (1, 0,
                                        'Month must be between 1 and 12. '
                                        'Press any key.'))
                        if self.any_key() == -1:
                            return -1
                        e = ''
                if goto_last is True:
                    goto_last = False
                    continue
                mon = int(edit)
                pass_mon = True

            edit = ''
            e = cur.KEY_BACKSPACE
            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:
                    pass_mon = False
                    goto_last = True
                    break
                elif len(edit) < 2 and e >= 48 and e <= 57:
                    edit += chr(e)
                self.draw_text(False,
                               (1, 0, 'Special date 2999-12-28 means that the '
                                'expires never.'),
                               (3, 0, 'Year: ' + str(y)),
                               (4, 0, 'Month: ' + str(mon)),
                               (5, 0, 'Day: ' + edit))
                if exp:
                    try:
                        self.stdscr.addstr(2, 0, 'Actual expiration date: ' +
                                           str(exp[0]) + '-' +
                                           str(exp[1]) + '-' +
                                           str(exp[2]))
                    except:
                        pass
                    finally:
                        self.stdscr.refresh()
                try:
                    e = self.stdscr.getch()
                except KeyboardInterrupt:
                    e = 4

                if e == NL and edit == '':
                    e = cur.KEY_BACKSPACE
                    continue
                elif (e == NL and (mon == 1 or mon == 3 or mon == 5 or
                                   mon == 7 or mon == 8 or mon == 10 or
                                   mon == 12) and
                      (int(edit) > 31 or int(edit) < 0)):
                    self.draw_text(False,
                                   (1, 0,
                                    'Day must be between 1 and 31. Press '
                                    'any key.'))
                    if self.any_key() == -1:
                        return -1
                    e = ''
                elif (e == NL and mon == 2 and (int(edit) > 28 or
                                                int(edit) < 0)):
                    self.draw_text(False,
                                   (1, 0,
                                    'Day must be between 1 and 28. Press '
                                    'any key.'))
                    if self.any_key() == -1:
                        return -1
                    e = ''
                elif (e == NL and (mon == 4 or mon == 6 or mon == 9 or
                      mon == 11) and (int(edit) > 30 or int(edit) < 0)):
                    self.draw_text(False,
                                   (1, 0,
                                    'Day must be between 1 and 30. Press '
                                    'any key.'))
                    if self.any_key() == -1:
                        return -1
                    e = ''
            if goto_last is True:
                goto_last = False
                pass_mon = False
                continue
            d = int(edit)
            break
        return (y, mon, d)
def get_manual_exp_date ( self , * exp ) : pass_y = False pass_mon = False goto_last = False while True : if pass_y is False : edit = '' e = cur . KEY_BACKSPACE 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 ) < 4 and e >= 48 and e <= 57 : edit += chr ( e ) self . draw_text ( False , ( 1 , 0 , 'Special date 2999-12-28 means that ' 'the expires never.' ) , ( 3 , 0 , 'Year: ' + edit ) ) if exp : try : self . stdscr . addstr ( 2 , 0 , 'Actual expiration date: ' + str ( exp [ 0 ] ) + '-' + str ( exp [ 1 ] ) + '-' + str ( exp [ 2 ] ) ) except : pass finally : self . stdscr . refresh ( ) try : e = self . stdscr . getch ( ) except KeyboardInterrupt : e = 4 if e == NL and edit == '' : e = cur . KEY_BACKSPACE continue y = int ( edit ) pass_y = True if pass_mon is False : edit = '' e = cur . KEY_BACKSPACE 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 : pass_y = False goto_last = True break elif len ( edit ) < 2 and e >= 48 and e <= 57 : edit += chr ( e ) self . draw_text ( False , ( 1 , 0 , 'Special date 2999-12-28 means that ' 'the expires never.' ) , ( 3 , 0 , 'Year: ' + str ( y ) ) , ( 4 , 0 , 'Month: ' + edit ) ) if exp : try : self . stdscr . addstr ( 2 , 0 , 'Actual expiration date: ' + str ( exp [ 0 ] ) + '-' + str ( exp [ 1 ] ) + '-' + str ( exp [ 2 ] ) ) except : pass finally : self . stdscr . refresh ( ) try : e = self . stdscr . getch ( ) except KeyboardInterrupt : e = 4 if e == NL and edit == '' : e = cur . KEY_BACKSPACE continue elif e == NL and ( int ( edit ) > 12 or int ( edit ) < 1 ) : self . draw_text ( False , ( 1 , 0 , 'Month must be between 1 and 12. ' 'Press any key.' ) ) if self . any_key ( ) == - 1 : return - 1 e = '' if goto_last is True : goto_last = False continue mon = int ( edit ) pass_mon = True edit = '' e = cur . KEY_BACKSPACE 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 : pass_mon = False goto_last = True break elif len ( edit ) < 2 and e >= 48 and e <= 57 : edit += chr ( e ) self . draw_text ( False , ( 1 , 0 , 'Special date 2999-12-28 means that the ' 'expires never.' ) , ( 3 , 0 , 'Year: ' + str ( y ) ) , ( 4 , 0 , 'Month: ' + str ( mon ) ) , ( 5 , 0 , 'Day: ' + edit ) ) if exp : try : self . stdscr . addstr ( 2 , 0 , 'Actual expiration date: ' + str ( exp [ 0 ] ) + '-' + str ( exp [ 1 ] ) + '-' + str ( exp [ 2 ] ) ) except : pass finally : self . stdscr . refresh ( ) try : e = self . stdscr . getch ( ) except KeyboardInterrupt : e = 4 if e == NL and edit == '' : e = cur . KEY_BACKSPACE continue elif ( e == NL and ( mon == 1 or mon == 3 or mon == 5 or mon == 7 or mon == 8 or mon == 10 or mon == 12 ) and ( int ( edit ) > 31 or int ( edit ) < 0 ) ) : self . draw_text ( False , ( 1 , 0 , 'Day must be between 1 and 31. Press ' 'any key.' ) ) if self . any_key ( ) == - 1 : return - 1 e = '' elif ( e == NL and mon == 2 and ( int ( edit ) > 28 or int ( edit ) < 0 ) ) : self . draw_text ( False , ( 1 , 0 , 'Day must be between 1 and 28. Press ' 'any key.' ) ) if self . any_key ( ) == - 1 : return - 1 e = '' elif ( e == NL and ( mon == 4 or mon == 6 or mon == 9 or mon == 11 ) and ( int ( edit ) > 30 or int ( edit ) < 0 ) ) : self . draw_text ( False , ( 1 , 0 , 'Day must be between 1 and 30. Press ' 'any key.' ) ) if self . any_key ( ) == - 1 : return - 1 e = '' if goto_last is True : goto_last = False pass_mon = False continue d = int ( edit ) break return ( y , mon , d )