def write_history (self): dir = adonthell.gamedata_user_data_dir () dir = dir + "/history" # -- try to open the file file = open (dir, 'w') if file != None: file.writelines (self.history[-50:]) file.close ()
def write_history(self): dir = adonthell.gamedata_user_data_dir() dir = dir + "/history" # -- try to open the file file = open(dir, 'w') if file != None: file.writelines(self.history[-50:]) file.close()
def read_history (self): dir = adonthell.gamedata_user_data_dir () dir = dir + "/history" # -- try to open the file try: file = open (dir, 'r') except IOError: return if file != None: self.history = file.readlines () self.hist_idx = len (self.history) file.close ()
def read_history(self): dir = adonthell.gamedata_user_data_dir() dir = dir + "/history" # -- try to open the file try: file = open(dir, 'r') except IOError: return if file != None: self.history = file.readlines() self.hist_idx = len(self.history) file.close()