Esempio n. 1
0
def main():
    mongo_setup.global_init()
    print('Hello, welcome to the engineering shop sign in system alpha. \n')
    svc.print_day()
    # attempt to run the login code
    try:
        while True:
            case = find_user_intent()
            if case == 'admin':
                admin.run()

            elif case == 'log':
                login.run()

            else:
                print(
                    "-------------------- NOT IMPLEMENTED ----------------------"
                )
            rule = input("\n Exit? [y/n]\n")
            if rule == 'y':
                break

    # exit if user presses CrtL+C, or something goes wrong
    except (KeyboardInterrupt, SystemError, SystemExit):
        print("\n----------------Goodbye-----------------\n")
        return 0
Esempio n. 2
0
def main():  # run the app

    login()

    while True:
        try:
            svc.print_day()
        except:
            mongo.global_disconnect()
            login_error()

        else:
            break

    root = Tk()
    app(root)
    root.mainloop()
Esempio n. 3
0
def main():  # run the app

    #print(f'{round(time.clock(),4)}: - - - - - Program execution Begin')
    login()
    #print(f'{round(time.clock(),4)}: - - - - - Cloud Login')

    while True:
        try:
            svc.print_day()  # check that cloud connection is alive
        except:
            mongo.global_disconnect()
            login_error()

        else:
            break

    root = tk.Tk()
    #print(f'{round(time.clock(),4)}: - - - - - App window launch')
    app(root)
    root.mainloop()
Esempio n. 4
0
    b = Button(pop, text="Acknowledge", command=pop.destroy)
    b.grid(row=1, column=0)


def login(event=None):
    StudentID = e.get()
    if not len(StudentID) == 8:
        return
    else:
        message = log_into_account(StudentID)
        if message == f"No student with ID {StudentID}":
            popup_create_student(str(StudentID))

        else:
            popup_hello(message)
    e.delete(0, END)


e.pack()
e.insert(0, "Enter your ID: ")
e.bind('<Return>', login)

myButton = Button(root, text="Enter Your Student ID", command=login)
myButton.pack()
AdminButton = Button(root, text="Run as Admin", command=admin.run)
AdminButton.pack()

if __name__ == '__main__':
    svc.print_day()
    root.mainloop()
Esempio n. 5
0
    def update(self):
        date = 'Today is: ' + svc.print_day() + f", time: " \
                                                f"{datetime.datetime.now().hour}:{datetime.datetime.now().minute} "

        self.statusbar.config(text=str(date))
        self.statusbar.after(1000, self.update)