Пример #1
0
 def __loadFromFile(self):
     file = open(self.__fileName, "r")
     try:
         line = file.readline().strip()
         while line != "":
             attributes = line.split(";")
             movie = Movie(int(attributes[0]), attributes[1], attributes[2],
                           attributes[3])
             MovieRepository.add(self, movie)
             line = file.readline().strip()
     except IOError:
         raise FileRepositoryException("Movie File error")
     finally:
         file.close()
Пример #2
0
 def add(self, movie):
     MovieRepository.add(self, movie)
     self.storeToFile()