def main(): in_file = get_storage_preference() # Set repositories. if in_file: personRepo = PersonFileRepository("storage/people.txt") activityRepo = ActivityFileRepository(personRepo, "storage/activities.txt") else: personRepo = PersonRepository() activityRepo = ActivityRepository() # Set controllers. peopleCtrl = PeopleController(personRepo) activitiesCtrl = ActivitiesController(personRepo, activityRepo) statsCtrl = StatsController(personRepo, activityRepo) undoRedoCtrl = UndoRedoController(peopleCtrl, activitiesCtrl) # Set console. ui = Console(peopleCtrl, activitiesCtrl, statsCtrl, undoRedoCtrl) # Run everything. ui.run() # Store to files if in_file: personRepo.store() activityRepo.store()
from domain.RouteValidator import RouteValidator from repository.RouteRepository import RouteRepository from controller.RouteController import RouteController from ui.Console import Console route_vali = RouteValidator() repo = RouteRepository("storage/routes.txt", route_vali) ctrl = RouteController(repo) ui = Console(ctrl) ui.run()
from tests.Test import Test from repo.Repository import * from repo.FileRepository import * from valid.Validare import ValidatorClient, ValidatorFilm, ValidatorInchiriere from business.Controllers import ControllerFilm, ControllerClient, ControllerInchiriere from ui.Console import Console t = Test() t.runTests() #filmRepo=FilmRepository() filmRepo = FilmFileRepo('filme.txt') #clientRepo=ClientRepository() clientRepo = ClientFileRepo('clienti.txt') #inchiriereRepo=InchiriereRepository() inchiriereRepo = InchiriereFileRepo('inchirieri.txt') validatorf = ValidatorFilm() validatorc = ValidatorClient() validatorinch = ValidatorInchiriere() contrFilm = ControllerFilm(filmRepo, validatorf) contrClient = ControllerClient(clientRepo, validatorc) contrInchiriere = ControllerInchiriere(inchiriereRepo, validatorinch, filmRepo, clientRepo) consola = Console(contrFilm, contrClient, contrInchiriere) consola.run()
def main(): prodRepo = ProductRepository("products.txt") pharmCtrl = PharmacyController(prodRepo) ui = Console(pharmCtrl) ui.run()
# rent1=Rent(101, 10, 'inchiriat') # #repoRents.add(rent1) # rent2=Rent(101, 42, 'inchiriat') # rent3=Rent(101, 19, 'inchiriat') # rent4=Rent(1, 10, 'inchiriat') # rent5=Rent(34, 42, 'inchiriat') # rent6=Rent(34, 19, 'inchiriat') # rent7=Rent(34, 199, 'inchiriat') # rent8=Rent(34,78 , 'inchiriat') # rent9=Rent(34, 20, 'inchiriat') # repoRents.add(rent2) # repoRents.add(rent3) # repoRents.add(rent4) # repoRents.add(rent5) # repoRents.add(rent6) # repoRents.add(rent7) # repoRents.add(rent8) validatorMovie = MovieValidator() validatorClient = ClientValidator() validatorRent = RentValidator() servMovies = MovieService(repoMovies, validatorMovie) servClients = ClientService(repoClients, validatorClient) servRents = RentService(repoMovies, repoClients, repoRents, servMovies, servClients) cons = Console(servMovies, servClients, servRents) cons.run()
from repo.GraphRepository import GraphRepository from solver.TSPSolver import TSPSolver from ui.Console import Console if __name__ == '__main__': repos = GraphRepository() repos.settingsFileName = 'settings/settings.txt' solver = TSPSolver(repos) console = Console(solver) console.run()
serviceStudent.addStudent(3, "Vaida George", 215) serviceStudent.addStudent(4, "Benga Ionut", 217) serviceStudent.addStudent(5, "Benga Vlad", 217) serviceStudent.addStudent(6, "Grigore Alin", 218) serviceStudent.addStudent(7, "Dragomir Manuel", 215) serviceStudent.addStudent(8, "Marica Andrada", 215) serviceStudent.addStudent(9, "Rauta Milena", 218) serviceStudent.addStudent(10, "Balinth Andrei", 219) serviceLaborator.addLaborator(2, 1, "strings", "22.10.2015") serviceLaborator.addLaborator(2, 2, "strings", "22.12.2015") serviceLaborator.addLaborator(2, 3, "strings", "22.12.2015") serviceLaborator.addLaborator(2, 4, "strings", "22.09.2015") serviceLaborator.addLaborator(3, 1, "clase", "22.10.2016") serviceLaborator.addLaborator(4, 1, "teste", "22.10.2017") serviceLaborator.addLaborator(5, 1, "arhitectura", "22.11.2015") serviceLaborator.addLaborator(6, 1, "operatii", "22.11.2015") serviceLaborator.addLaborator(6, 2, "operatii", "22.12.2015") serviceNota.addNota(2, 2, 1, 10) serviceNota.addNota(3, 2, 2, 9) serviceNota.addNota(4, 2, 2, 10) serviceNota.addNota(6, 2, 4, 6) serviceNota.addNota(6, 3, 1, 3) serviceNota.addNota(7, 2, 2, 10) serviceNota.addNota(3, 6, 1, 2) serviceNota.addNota(6, 6, 1, 5) c = Console(serviceStudent, serviceLaborator, serviceNota) c.run()
''' Created on Nov 3, 2016 @author: AndreiMsc ''' from repository.Student_repository import Student_repository from controller.Student_controller import Student_controller from repository.Assignment_repository import Assignment_repository from controller.Assignment_controller import Assignment_controller from ui.Console import Console stud_repo = Student_repository() stud_ctrl = Student_controller(stud_repo) assign_repo = Assignment_repository() assign_ctrl = Assignment_controller(assign_repo) con = Console(stud_ctrl, assign_ctrl) con.run()