def __init__(self, fName): self.__fName = fName self.validator = Validator() self.labList = list() try: self.__labFile = open(self.__fName, "r") except IOError: self.__labFile = open(self.__fName, "w") self.__labFile.close() self.__labFile = open(self.__fName, "r") self.readFile()
def __init__(self, fName): self.__fileName = fName self.contactList = list() self.validator = Validator() try: self.__contactsFile = open(self.__fileName, "r") except IOError: self.__contactsFile = open(self.__fileName, "w") self.__contactsFile.close() self.__contactsFile = open(self.__fileName, "r") self.readFile()
''' 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()
''' 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()