Ejemplo n.º 1
0
 def loadStatistics(self):
     if not os.path.exists(self.fn.stats):
         return
     stats = unpickle(self.fn.stats)
     if stats:
         # print "loaded:", stats.__dict__
         self.stats.__dict__.update(stats.__dict__)
     # start a new session
     self.stats.session_games = {}
     self.stats.session_balance = {}
     self.stats.gameid_balance = 0
Ejemplo n.º 2
0
 def loadOptions(self):
     self.opt.setDefaults(self.top)
     if os.path.exists(self.fn.opt):
         # for backwards compatibility
         opt = unpickle(self.fn.opt)
         if opt:
             self.opt.__dict__.update(opt.__dict__)
         try:
             os.remove(self.fn.opt)
         except Exception:
             pass
     self.opt.load(self.fn.opt_cfg)
     self.opt.setConstants()