def constructFromFile(self): self.constructNewBoard() try: self.file = FileUtil.openForRead(os.path.join(FileUtil.getProgramDirectory(), "maps", self.mapName + ".battlefield")) except IOError: print "Error loading map" ships = Formatter.stripShips(Formatter.convertMatrix(self.file)) self.board.addShips(ships)