Beispiel #1
0
    def readTime(self):
        timelist = [0,0,0,0]
        out = self.ohandler
        out.set_second_line(out.list_to_time(timelist))
        out.write_display()
        out.move_Cursor(out.cursor_col,out.cursor_row)
        out.blink()
        for i in range (0,len(timelist)):
            if(out.cursor_col == 2 or out.cursor_col == 5):
                out.cursor_col+=1
            out.move_Cursor(out.cursor_col,out.cursor_row)
            while True:
                key = self.readKey()
                try:
                    key = int(key)
                    timelist[i] = key
                    break
                except:
                    if(ord(key) == 127):
                        return None

            out.set_second_line(out.list_to_time(timelist))
            out.write_display()
            out.cursor_col+=1
        out.unblink() 
        out.cursor_col=0
        out.cursor_row=1
        return Timer(Timer.timelist_to_seconds(timelist))