def newRace(self): self.race = emptyRace() self.setColumnMaps() self.reset() self.updateOdds() self.filename = None self.dirty = False
def load(self, filename=None): oldfile = self.filename oldrace = self.race if filename is not None: self.filename = filename if self.filename is not None: self.race = Race() if not self.race.load(self.filename): self.race = oldrace self.filename = oldfile if oldrace is None: self.race = emptyRace() return False self.setColumnMaps() self.reset() self.updateOdds() self.dirty = False return True else: self.race = emptyRace() self.reset() self.updateOdds() self.dirty = False return False
def load(self, filename = None): oldfile = self.filename oldrace = self.race if filename is not None: self.filename = filename if self.filename is not None: self.race = Race() if not self.race.load(self.filename): self.race = oldrace self.filename = oldfile if oldrace is None: self.race = emptyRace() return False self.setColumnMaps() self.reset() self.updateOdds() self.dirty = False return True else: self.race = emptyRace() self.reset() self.updateOdds() self.dirty = False return False