예제 #1
0
 def __loadFromFile(self):
     try:
         f = open(self.__fName, "r")
         line = f.readline().strip()
         while line != "":
             attributes = line.split(";")
             book = Rental(attributes[0], attributes[1], attributes[2],
                           attributes[3], attributes[4], attributes[5])
             RepoRental.addElement(self, book, 0)
             line = f.readline().strip()
     except IOError:
         raise RepoFileError()
     finally:
         f.close()
예제 #2
0
 def addElement(self, element, param):
     RepoRental.addElement(self, element, param)
     self.__addElementToFile()