1 # Save and resume progress in lightcards
11 hasher = hashlib.md5()
14 return(hasher.hexdigest())
18 return gen_hash(str(stra).encode("utf-8"))
21 def dump(obj, typer, stra):
22 dired = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/"
23 if os.path.exists(dired):
27 pickle.dump(obj, open(f"{dired}/{typer}.p", "wb"))
30 def dive(typer, stra):
31 file = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/" + \
33 if os.path.exists(file):
34 return pickle.load(open(file, "rb"))
40 dired = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/"
44 dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
51 if __name__ == "__main__":