Beispiel #1
0
def main():
    car_repository = GenericFileRepository("cars.pkl")
    car_validator = CarValidator()
    customer_card_repository = GenericFileRepository("cards.pkl")
    customer_card_validator = CustomerCardValidator()
    transaction_repository = GenericFileRepository("transactions.pkl")
    transaction_validator = TransactionValidator()
    car_service = CarService(car_repository,
                             car_validator,
                             transaction_repository)
    customer_card_service = CardService(customer_card_repository,
                                        customer_card_validator,
                                        transaction_repository)
    transaction_service = TransactionService(transaction_repository,
                                             transaction_validator,
                                             customer_card_repository,
                                             car_repository)

    ui = Console(car_service,
                 customer_card_service,
                 transaction_service)
    ui.run_console()
Beispiel #2
0
'''
Created on Jan 25, 2013

@author: Mihai
'''
from Repository.Repository import StudentRepository, LabRepository
from UI.Console import Console
from UI.Controller import LabController

if __name__ == '__main__':
    studentRepository=StudentRepository("student.txt")
    labRepository=LabRepository("labs.txt")
    labController=LabController(studentRepository,labRepository)
    labConsole=Console(labController)
    labConsole.run()
Beispiel #3
0
'''
from Repositories.Repository import GenericRepository
from Repositories.RentalRepository import RentalRepository
from Controller.ClientController import ClientController
from Controller.CarController import CarController
from Controller.RentalController import RentalController
from UI.Console import Console
from Domain.Client import Client
from Domain.Car import Car
from Repositories.ClientRepository import ClientRepository
from Repositories.CarRepository import CarRepository

repo_clients = ClientRepository()
repo_clients.add(Client("1", "client1"))
repo_clients.add(Client("2", "client2"))
repo_clients.add(Client("3", "client3"))

repo_cars = CarRepository()
repo_cars.add(Car("1", "car1"))
repo_cars.add(Car("2", "car2"))
repo_cars.add(Car("3", "car3"))

repo_rentals = RentalRepository()

ctrl_clients = ClientController(repo_clients)
ctrl_cars = CarController(repo_cars)
ctrl_rentals = RentalController(repo_clients, repo_cars, repo_rentals)

ui = Console(ctrl_cars, ctrl_clients, ctrl_rentals)

ui.show()
Beispiel #4
0
'''
Created on 22.02.2013

@author: mihai_000
'''
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller

if __name__ == '__main__':
    bookRepository = Repository ("books.txt")
    bookValidator = Validator ()
    bookController = Controller (bookRepository,bookValidator)
    bookConsole = Console (bookController)
    bookConsole.run()
from Repository.GenericFileRepository import GenericFileRepository
from Service.DrugService import DrugService
from Service.CardService import CardService
from Service.TransactionService import TransactionService
from UI.Console import Console

drug_repository = GenericFileRepository("drugs.pkl")
card_repository = GenericFileRepository("cards.pkl")
transaction_repository = GenericFileRepository("transactions.pkl")
drug_service = DrugService(drug_repository, transaction_repository)
card_service = CardService(card_repository, transaction_repository)
transaction_service = TransactionService(transaction_repository, drug_repository)
console = Console(drug_service, card_service, transaction_service)
console.run_console()
Beispiel #6
0
repoUndo = Undo_Repository()

validDiscipline = validDiscipline()
servDiscipline = servDiscipline(validDiscipline, repoDiscipline)

validGrade = validGrade()
servGrade = servGrade(validGrade,repoGrade)

validStudent = validStudent()
servStudent = servStudent(validStudent, repoStudent,repoUndo)

if type[0] == "memory" :
    disciplineIndex = 0
    disciplinesArray = ["Mate","Romana","Fizica","Sport","Ed. Anteprenoriala", "Chimie","Informatica","TIC","Religie","Engleza","Franceza","Germana","Desen","Muzica"]
    for x in disciplinesArray:
        disciplineIndex = disciplineIndex + 1
        servDiscipline.add_discipline(disciplineIndex,x)
    
    for x in range(1,101):
        servGrade.add_grade(x,randint(1,14),randint(1,100),round(random.uniform(1,10),2))
    
    studentIndex = 0
    studentArray1 = ["Mihai","Ionut","Crbl","Smiley","Ion","Flaviu","Catalin","Gabriel","Cristi","Andrei","Alex","Alexandru","Razvan","Richard"]
    studentArray2 = ["Pop","Popescu","Popa","Denes","Carlos","Stanescu","Eminescu"]
    for x in range(1,101):
        servStudent.add_student(x,random.choice(studentArray1)+random.choice(studentArray2))

servUndo = UndoService(repoUndo,repoStudent,repoDiscipline,repoGrade)

console = Console(servStudent, servDiscipline, servGrade,servUndo)
console.Run()
Beispiel #7
0
'''
Created on 29.01.2013

@author: mihai_000
'''
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller

if __name__ == '__main__':
    agendaRepository = Repository ("contacts.txt")
    agendaController = Controller (agendaRepository)
    agendaConsole = Console (agendaController)
    agendaConsole.run()
Beispiel #8
0
from Domain.Assignment import Assignment
from Repositories.StudentRepository import StudentRepository
from Repositories.AssignmentsRepository import AssignmentRepository
from Controller.UndoController import UndoController
from Domain.Rental import Rental
from Domain.RentalDTO import RentalDTO

repo_students = StudentRepository()
repo_students.add(Student("1", "student1","100"))
repo_students.add(Student("2", "student2","200"))
repo_students.add(Student("3", "student3","300"))

repo_assignments = AssignmentRepository()
repo_assignments.add(Assignment("1", "car1"))
repo_assignments.add(Assignment("2", "car2"))
repo_assignments.add(Assignment("3", "car3"))

repo_rentals = RentalRepository()
repo_rentals.add(RentalDTO("1", "1", 1))
repo_rentals.add(RentalDTO("2", "1", 2))
repo_rentals.add(RentalDTO("3", "1", 3))

ctrl_undo = UndoController()
ctrl_students = StudentController(ctrl_undo, repo_rentals, repo_students)
ctrl_assignments = AssignmentController(ctrl_undo, repo_rentals, repo_assignments)
ctrl_rentals = RentalController(repo_students, repo_assignments, repo_rentals)

ui = Console(ctrl_undo, ctrl_assignments, ctrl_students, ctrl_rentals)

ui.show()
Beispiel #9
0
'''
Created on 23.02.2013

@author: mihai_000
'''
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller, test_Controller

if __name__ == '__main__':
    transRepository = Repository("dictionary.txt")
    testRepository = Repository("test.txt")
    transValidator = Validator()
    transController = Controller(transRepository, transValidator)
    testController = test_Controller(testRepository, transValidator)
    transConsole = Console(transController)
    transConsole.run()
Beispiel #10
0
from Models.Entities import Graph
from UI.Console import Console

myGraph = Graph()
ui = Console(myGraph)
ui.run()
Beispiel #11
0
from Repository.clientRepository import clientRepository
from Domain.Validator import clientValidator, movieValidator
from Controller.Controller import clientController, movieController, rentController
from UI.Console import Console
from Repository.movieRepository import movieRepository
from Repository.rentRepository import rentRepository

clientRepo = clientRepository()
clientValidator = clientValidator()
movieRepo = movieRepository()
movieValidator = movieValidator()
rentRepo = rentRepository()
clientController = clientController(clientRepo, clientValidator)
movieController = movieController(movieRepo, movieValidator)
rentController = rentController(rentRepo)
ui = Console(clientController, movieController, rentController)

ui.showUI()
Beispiel #12
0
from Repository.RepositoryCar import RepositoryCar
from Repository.RepositoryCard import RepositoryCard
from Repository.RepositoryTransaction import RepositoryTransaction
from Service.CarService import CarService
from Service.CardService import CardService
from Service.TransactionService import TransactionService
from UI.Console import Console
if __name__ == '__main__':
    repoCar = RepositoryCar("masini.txt")
    repoCard = RepositoryCard("carduri.txt")
    repoTran = RepositoryTransaction("tranzactii.txt")
    serviceCar = CarService(repoCar, repoTran)
    serviceCard = CardService(repoCard)
    serviceTransaction = TransactionService(repoTran, serviceCar)
    console = Console(serviceCar, serviceCard, serviceTransaction)
    console.run_console()
Beispiel #13
0
def main():
    show_repository = ShowRepository('shows.txt')
    show_service = ShowService(show_repository)

    console = Console(show_service)
    console.run()
Beispiel #14
0
from Repository.clientRepository import clientRepository
from Domain.Validator import clientValidator, movieValidator
from Controller.Controller import clientController, movieController, rentController
from UI.Console import Console
from Repository.movieRepository import movieRepository
from Repository.rentRepository import rentRepository

clientRepo = clientRepository()
clientValidator = clientValidator()
movieRepo = movieRepository()
movieValidator = movieValidator()
rentRepo = rentRepository()
clientController = clientController(clientRepo, clientValidator)
movieController = movieController(movieRepo, movieValidator)
rentController = rentController(rentRepo)
ui = Console(clientController, movieController, rentController)

ui.showUI()
Beispiel #15
0
5. Unlimited undo/redo functionality. Each step will undo/redo the previous operation performed by the user. 
Undo/redo operations must cascade and have a memory-efficient implementation (no superfluous list copying). 
'''
from Repository.Repository import Repository
from Repository.StudentBinaryRepository import StudentPickleFileRepository
from Repository.StudentCSVRepository import StudentCSVFileRepository
from Tests.Tests import Test
from Validators.Validators import gradeValidator, studentValidator, assigValidator
from Controllers.Controllers import studentController, assignmentController, gradeController
from UI.Console import Console

t = Test()
t.runTests()

#repoStudents = Repository()
#repoStudents = StudentPickleFileRepository()
repoStudents = StudentCSVFileRepository()

repoAssignments = Repository()
repoGrade = Repository()

gradeValid = gradeValidator()
studentValid = studentValidator()
assigValid = assigValidator()

studentCtrl = studentController(repoStudents, studentValid)
assigCtrl = assignmentController(repoAssignments, assigValid)
gradeCtrl = gradeController(repoGrade, repoStudents, gradeValid)

console = Console(studentCtrl, assigCtrl, gradeCtrl)
console.run()
Beispiel #16
0
    for i in range(1,len(arr) - 1):
        if (len(arr[i]) == 1):
            oprds.append(arr[i][0])
        cnt+=1

    oprds.append(arr[cnt][0])

    op = arr[0][1]
    res = arr[cnt+1][0]
    if op == '+':
        return Problem(oprds, res, op)
    else:
        first = oprds[0]
        oprds[0] = res
        res = first
        return Problem(oprds, res, op)

if __name__=='__main__':
    path = "input.txt"


    pr = readFromFile(path)
    ctrl = Controller(pr)
    console = Console(ctrl, pr)
    console.run()

    # print(ctrl.DFS(pr.getRoot()))
    # print(ctrl.GBFS(pr.getRoot()))


Beispiel #17
0
from TestUnit.Teste import Teste
from UI.Console import Console
from infrastructure.FilmRepo import FilmRepo
from infrastructure.ClientRepo import ClientRepo
from infrastructure.InchirieriRepo import InchirieriRepo
from validare.Validare import Validare
from controller.ClientService import ClientService
from controller.FilmService import FilmService
from controller.InchirieriService import InchirieriService

if __name__ == "__main__":
    teste = Teste()
    teste.run_all_tests()
    clientRepo = ClientRepo()
    filmRepo = FilmRepo()
    inchirieriRepo = InchirieriRepo()
    valid = Validare()
    clientService = ClientService(clientRepo, valid)
    filmService = FilmService(filmRepo, valid)
    inchirieriService = InchirieriService(inchirieriRepo, clientService,
                                          filmService)
    console = Console(clientService, filmService, inchirieriService)
    console.run()

#Sterge inchirierea!!!!!
Beispiel #18
0
'''
Created on 22.02.2013

@author: mihai_000
'''
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller

if __name__ == '__main__':
    bookRepository = Repository("books.txt")
    bookValidator = Validator()
    bookController = Controller(bookRepository, bookValidator)
    bookConsole = Console(bookController)
    bookConsole.run()
Beispiel #19
0
        okay = 1
    elif line[1].strip() == "textfiles":
        #okay = 1
        line1 = file.readline().strip().split("=")
        line1[1] = line1[1].strip()[1:len(line1[1]) - 2]
        person_repository = prs_file_repo(line1[1].strip(), PersonValidator)
        line2 = file.readline().strip().split("=")
        line2[1] = line2[1].strip()[1:len(line2[1]) - 2]
        activity_repository = acts_file_repo(line2[1].strip(),
                                             ActivityValidator)
    else:
        #okay = 1
        line1 = file.readline().strip().split("=")
        line1[1] = line1[1].strip()[1:len(line1[1]) - 2]
        person_repository = PersonPickleRepo(line1[1].strip())
        line2 = file.readline().strip().split("=")
        line2[1] = line2[1].strip()[1:len(line2[1]) - 2]
        activity_repository = ActivityPickleRepo(line2[1].strip())
    #activity_repository = acts_file_repo("Activities.txt", ActivityValidator)
    activity_service = ActivityService(activity_repository)
    person_service = PersonService(person_repository, activity_repository)
    statistics = Statistics(activity_repository, person_repository,
                            activity_service, person_service)
    console = Console(activity_service, person_service, statistics)
    if okay == 1:
        console.generate_entities()

    console.run_menu()
except Exception as ex:
    print("caught exception in main; printing stacktrace")
    traceback.print_exc()
Beispiel #20
0
"""
Created on 23.02.2013

@author: mihai_000
"""
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller, test_Controller

if __name__ == "__main__":
    transRepository = Repository("dictionary.txt")
    testRepository = Repository("test.txt")
    transValidator = Validator()
    transController = Controller(transRepository, transValidator)
    testController = test_Controller(testRepository, transValidator)
    transConsole = Console(transController)
    transConsole.run()
Beispiel #21
0
from Repositories.Repository import Repository
from Controller.Controller import Controller
from UI.Console import Console
from Domain.Square import SquareValidator

if __name__ == '__main__':
    validator = SquareValidator()
    repository = Repository()
    controller = Controller(validator, repository)
    console = Console(controller)

    console.start()
Beispiel #22
0
from Repositories.Repository import GenericRepository
from Repositories.RentalRepository import RentalRepository
from Controller.ClientController import ClientController
from Controller.CarController import CarController
from Controller.RentalController import RentalController
from UI.Console import Console
from Domain.Client import Client
from Domain.Car import Car
from Repositories.ClientRepository import ClientRepository
from Repositories.CarRepository import CarRepository


repo_clients = ClientRepository()
repo_clients.add(Client("1", "client1"))
repo_clients.add(Client("2", "client2"))
repo_clients.add(Client("3", "client3"))

repo_cars = CarRepository()
repo_cars.add(Car("1", "car1"))
repo_cars.add(Car("2", "car2"))
repo_cars.add(Car("3", "car3"))

repo_rentals = RentalRepository()

ctrl_clients = ClientController(repo_clients)
ctrl_cars = CarController(repo_cars)
ctrl_rentals = RentalController(repo_clients, repo_cars, repo_rentals)

ui = Console(ctrl_cars, ctrl_clients, ctrl_rentals)

ui.show()