Example #1
0
    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 ()
Example #2
0
    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()
Example #3
0
    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 ()
Example #4
0
    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()