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 not os.path.exists(dired):
26 pickle.dump(obj, open(f"{dired}/{typer}.p", "wb"))
29 def dive(typer, stra):
30 file = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/" + \
32 if os.path.exists(file):
33 return pickle.load(open(file, "rb"))
39 dired = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/"
43 dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
50 if __name__ == "__main__":