Пример #1
0
        connected = True
        connection = result[1]

    else:
        #I think here should be a function that handles the various errors
        #by calling a Popup with the appropriate message
        #For example, 1045 is username/password not good
        #The error message is in result[1]
        Popup("There was an error logging in").anyKey()
        
screen = WelcomeScreen()
database_name = screen.run(connection)       #WelcomeScreen.run() returns a string of a database to use

while connected:
    screen = Menu(database_name)
    option = screen.mainMenu() 
    c = commandSQL.CommandSQL(connection)
    if option == 1:     #view tables
        screen = TableScreen(connection) 
        screen.run()
    if option == 2:     #Create Table
        curses.curs_set(1)
        c.createTable(screen)
    if option == 3:     #Add Row
        screen = TableScreen(connection, insertFlag=True)
        screen.run()
    if option == 4:     #Drop Table
        curses.curs_set(1)
        c.dropTable(screen)
    if option == 5:     #Alter Table
        curses.curs_set(1)