fix cache in python3
This commit is contained in:
parent
08a93ece26
commit
47cb16d931
@ -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)
|
||||
|
||||
@ -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__':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user