Exemplo n.º 1
0
def main():
    """
    The main method of the application.
    It instantiates a console and runs it.
    """
    app = Console()
    app.run()
Exemplo n.º 2
0
def main():
    """
    The main method of the application.
    It instantiates a console and runs it.
    """
    app = Console()
    app.run()
Exemplo n.º 3
0
def main():
    try:
        Test().testEverything()
        print("All tests passed :).")
    except Exception as e:
        print("Some tests failed :(.")
        print(e)

    repo = RouteRepository()
    controller = RouteController(repo)
    app = Console(controller)

    app.run()
Exemplo n.º 4
0
if workingApp:
    '''
    initializing all the validators
    '''
    validatorStudent = StudentValidator()
    validatorAssignments = AssignmentValidator()
    validatorGrades = GradeValidator()
    '''
    initializing all the controllers
    '''
    controllerStudents = contrStudents(repoStudents, validatorStudent)
    controllerAssignments = contrAssignments(repoAssignments,
                                             validatorAssignments)
    controllerGrades = contrGrades(repoGrades, validatorGrades, repoStudents,
                                   repoAssignments)
    undoAction = undoAction(controllerStudents, controllerAssignments,
                            controllerGrades)
    '''
    creating the data 
    '''
    if inmemory:
        data = Data(controllerStudents, controllerAssignments,
                    controllerGrades)
        data.createData()
    '''
    running the console
    '''
    console = Console(controllerStudents, controllerAssignments,
                      controllerGrades, undoAction)
    console.run()
Exemplo n.º 5
0
if __name__ == '__main__':
    settings = Settings()
    if settings.repo_mode == "inmemory":
        person_repository = Repository()
        activity_repository = Repository()
        appointment_repository = Repository()
    elif settings.repo_mode == "textfile":
        person_repository = FileRepository(Person, settings.persons_repo)
        activity_repository = FileRepository(Activity, settings.activity_repo)
        appointment_repository = FileRepository(Appointment, settings.apppoinment_repo)
    elif settings.repo_mode == "binary":
        person_repository = BinaryRepository(Person, settings.persons_repo)
        activity_repository = BinaryRepository(Activity, settings.activity_repo)
        appointment_repository = BinaryRepository(Appointment, settings.apppoinment_repo)


    personCtrl = PersonController(person_repository)
    activityCtrl = ActivityController(activity_repository, person_repository)
    appointmentCtrl = AppointmentController(appointment_repository, person_repository)
    print("Controllers created")

    cons = Console(personCtrl, activityCtrl, appointmentCtrl)
    print("Console created")

    # personCtrl.populate_repo()
    # print("Person Repository populated")
    # cons.populate_activity()
    # print("Repositories populated")

    cons.run()
Exemplo n.º 6
0
from Graph.graph_class import DirectedGraph
from ui.console import Console

if __name__ == "__main__":
    graph = DirectedGraph()
    app = Console(graph, "sample.txt")
    print("Please wait until the file reading has finished!")
    app.run()
Exemplo n.º 7
0
'''
Created on Feb 8, 2019

Modulul principal al aplicatiei

@author: Silviu Anton
'''
from ui.console import Console

if __name__ == '__main__':

    myConsole = Console()
    myConsole.run()
Exemplo n.º 8
0
Created on 28 Nov 2018

@author: Marius
'''
from validation.validators import validClient, validBook, validRental
from persistence.repositories import RepoBook, RepoClient, RepoRental
from business.controllers import ServBook, ServClient, ServRental
from ui.console import Console

repoBook = RepoBook()
validBook = validBook()
servBook = ServBook(validBook, repoBook)

servBook.addBook(1, "Papillon", "Henri Charriere", "Based on a real story")
servBook.addBook(2, "Mythology", "Thor Sonofodin",
                 "Book about Norse Mythology")

repoClient = RepoClient()
validClient = validClient()
servClient = ServClient(validClient, repoClient)

servClient.addClient(1, "JeanValjean")
servClient.addClient(2, "AlanWatts")

repoRental = RepoRental()
validRental = validRental()
servRental = ServRental(validRental, repoRental, repoClient, repoBook)

c = Console(servClient, servBook, servRental)
c.run()