Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reading the File
class KeyValueStore:
...
def catch_up(self, path_to_logs=''):
if path_to_logs == '':
path_to_logs = "logs/" + self.server_name + "_log.txt"
if os.path.exists(path_to_logs):
f = open(path_to_logs, "r")
log = f.read()
f.close()
for command in log.split('\n'):
self.execute(command, term_absent=False, write=False)
self.catch_up_successful = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment