예제 #1
0
def events():
    if var.event in var.close:
        var.terminate = True
    elif var.event == 'Home':
        var.active = 0
        var.window.close()
        f.exgenwin()
    elif var.event == 'Checkin':
        var.QR_String = var.values['qr']
        f.QR_Extraction(var.QR_String)
        if var.Date.date() > datetime.now().date():
            var.indays = (var.Date.date() - datetime.now().date()).days
            var.active = 4
            var.window.close()
            f.exgenwin()
        elif var.Date > datetime.now():
            var.active = 5
            var.window.close()
            f.exgenwin()
#        elif datetime.combine(var.Date.date(),f.get_end(var.Date, var.Time)) < datetime.now() < var.Date:
        else:
            var.length = f.toseconds(
                datetime.strptime(var.Time, "%H:%M").time())
            var.end = f.get_end(var.Date, var.Time)
            var.countdown = True
            var.active = 3
            var.window.close()
            f.exgenwin()
예제 #2
0
def genwin2():
    var.layout = [[sg.Text('information read from the QR code')],
                  [
                      sg.Text("begin: " + str(var.Date.time()) + ", end: " +
                              str(f.get_end(var.Date, var.Time)))
                  ],
                  [
                      sg.Text("Time Remaining: "),
                      sg.Text("", size=(20, 1), key="Time")
                  ],
                  [
                      sg.ProgressBar(var.length,
                                     orientation='h',
                                     size=(70, 20),
                                     key='status')
                  ], [sg.Button('Back'), sg.Button('Home')]]

    var.window = sg.Window('Checkedin', var.layout, size=(1024, 600))