Created
December 24, 2019 15:32
-
-
Save chelseatroy/d7e5352649f4de6eba55f85621204c8e to your computer and use it in GitHub Desktop.
Reading the File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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