Beispiel #1
0
def scheduleProjectsCreateSchedule():
    fileManager = FileManager()
    fileManager.writeScheduleCSV()
    Common.cls()
    print("---CREATE SCHEDULE---")
    print("Schedule Created!")
    Common.pause()
Beispiel #2
0
def inputProjectDetails():

    fileManager = FileManager()

    Common.cls()

    print("--- INPUT PROJECT DETAILS ---")
    newId = fileManager.getNewId()
    print("Project ID: {}".format(newId))
    try:
        title = input("Title: ")

        if len(title) < 1:
            raise TypeError

        size = int(input("Size (number of pages): "))

        if size < 1:
            raise ValueError
        priority = int(input("Priority: "))

        if priority < 1:
            raise ValueError
    except ValueError:
        print("Please enter a positive integer.")
        Common.pause()
        return
    except TypeError:
        print("Title must not be empty.")
        Common.pause()
        return

    fileManager.appendRecord([[newId, title, size, priority, "False"]])
Beispiel #3
0
def scheduleProjectsViewSchedule():
    fileManager = FileManager()
    Common.cls()
    print("--- VIEW UPDATED SCHEDULE ---")
    schedule = fileManager.viewUpdatedSchedule()
    if schedule:
        for project in schedule:
            print("Project ID: {}".format(project[0]))
            print("Title: {}".format(project[1]))
            print("Size: {}".format(project[2]))
            print("Priority: {}".format(project[3]))
            print("----------")
    else:
        print("There is no schedule created yet. Do it now.")

    Common.pause()
Beispiel #4
0
def viewProjectsCompletedProjects():
    fileManager = FileManager()
    Common.cls()
    print("--- VIEW PROJECTS: COMPLETED ---")
    completedProjects = fileManager.getAllCompletedProjects()
    if completedProjects:
        for project in completedProjects:
            print("Project ID: {}".format(project[0]))
            print("Title: {}".format(project[1]))
            print("Size: {}".format(project[2]))
            print("Priority: {}".format(project[3]))
            print("----------")
    else:
        print("There is no projects completed yet.")

    Common.pause()
Beispiel #5
0
def viewProjectsAllProjects():
    fileManager = FileManager()
    Common.cls()
    print("--- VIEW PROJECTS: ALL ---")
    allProjects = fileManager.getAllProjects()
    if allProjects:
        for project in allProjects:
            print("Project ID: {}".format(project[0]))
            print("Title: {}".format(project[1]))
            print("Size: {}".format(project[2]))
            print("Priority: {}".format(project[3]))
            print("Completed: {}".format(project[4]))
            print("----------")
    else:
        print("There is no projects entered yet.")

    Common.pause()
Beispiel #6
0
def viewProjectsOneProject():
    fileManager = FileManager()

    try:
        projectID = input("Enter Project ID: ")

        if int(projectID) not in range(1, fileManager.getNewId()):
            raise ValueError
    except ValueError:
        print("Project with ID {} does not exist.".format(projectID))

        Common.pause()
        return

    project = fileManager.getProjectInfo(projectID)
    Common.cls()
    print("--- VIEW PROJECTS: {} ---".format(project[1]))
    print("Project ID: {}".format(project[0]))
    print("Title: {}".format(project[1]))
    print("Size: {}".format(project[2]))
    print("Priority: {}".format(project[3]))
    print("Completed: {}".format(project[4]))

    Common.pause()
Beispiel #7
0
def getProject():
    fileManager = FileManager()

    # Display schedule
    Common.cls()
    print("--- PROJECT SCHEDULE ---")
    schedule = fileManager.viewUpdatedSchedule()
    if schedule:
        for project in schedule:
            print("Project ID: {}".format(project[0]))
            print("Title: {}".format(project[1]))
            print("Size: {}".format(project[2]))
            print("Priority: {}".format(project[3]))
            print("----------")
    else:
        print("There is no schedule created yet. Do it now.")
        Common.pause()
        return

    input("Press ENTER to get a project...")

    # update projects and schedule
    fileManager.updateCompletionCSV(schedule[0][0])

    Common.cls()
    print("--- PROJECT SCHEDULE ---")
    print("Topmost project has been removed from queue.")

    Common.pause()

    Common.cls()
    print("--- NEW PROJECT SCHEDULE ---")
    schedule = fileManager.viewUpdatedSchedule()
    if schedule:
        for project in schedule:
            print("Project ID: {}".format(project[0]))
            print("Title: {}".format(project[1]))
            print("Size: {}".format(project[2]))
            print("Priority: {}".format(project[3]))
            print("----------")
    else:
        print("There is nothing in the queue anymore.")

    Common.pause()