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):
|
def cache_picture(self, source, target, options):
|
||||||
self.cache[target] = {"size": os.path.getsize(source), "options": remove_superficial_options(options)}
|
self.cache[target] = {"size": os.path.getsize(source), "options": remove_superficial_options(options)}
|
||||||
|
|
||||||
def __del__(self):
|
def cache_dump(self):
|
||||||
self.json.dump(self.cache, open(self.cache_file_path, "wb"))
|
self.json.dump(self.cache, open(self.cache_file_path, "w"))
|
||||||
|
|
||||||
|
|
||||||
CACHE = Cache(json=json)
|
CACHE = Cache(json=json)
|
||||||
|
|||||||
@ -601,6 +601,7 @@ def main():
|
|||||||
open(Path("build").joinpath("feed.xml"), "wb").write(xml)
|
open(Path("build").joinpath("feed.xml"), "wb").write(xml)
|
||||||
|
|
||||||
build_index(settings, front_page_galleries_cover, templates)
|
build_index(settings, front_page_galleries_cover, templates)
|
||||||
|
CACHE.cache_dump()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user