Esempio n. 1
0
        if cmd[0] in exitCommands:
            quit()

        elif cmd[0] in helpCommands:
            print(helpText)

        elif cmd[0] in createTableCommands:
            try:
                id = Tables.create(cmd[1])
                print("Table \"{}\" created. ID = {}".format(cmd[1], id))
            except:
                error()

        elif cmd[0] in createTaskCommands:
            try:
                id = Tasks.create(*cmd[1:4:], " ".join(
                    cmd[4::])) if len(cmd) > 3 else Tasks.create(
                        cmd[1], cmd[2])
                print("Task \"{}\" created. ID = {}".format(cmd[2], id))
            except:
                error()

        elif cmd[0] in listTableCommands:
            try:
                tableName = Tables.list()[int(cmd[1]) - 1][1]
                tasks = Tasks.getTasksFromTable(cmd[1])
                printTable(tableName, tasks)
            except:
                error()

        elif cmd[0] in listOfTablesCommands:
            try: