fix cache in python3

This commit is contained in:
Adrien Beudin 2017-07-12 13:39:45 +02:00
parent 08a93ece26
commit 47cb16d931
2 changed files with 3 additions and 3 deletions

View File

@ -53,8 +53,7 @@ class Cache(object):
def cache_picture(self, source, target, options):
self.cache[target] = {"size": os.path.getsize(source), "options": remove_superficial_options(options)}
def __del__(self):
self.json.dump(self.cache, open(self.cache_file_path, "wb"))
def cache_dump(self):
self.json.dump(self.cache, open(self.cache_file_path, "w"))
CACHE = Cache(json=json)

View File

@ -601,6 +601,7 @@ def main():
open(Path("build").joinpath("feed.xml"), "wb").write(xml)
build_index(settings, front_page_galleries_cover, templates)
CACHE.cache_dump()
if __name__ == '__main__':