Don't keep files in memory when not using cache

This commit is contained in:
2017-10-17 18:46:05 +02:00
parent 89bf2aba03
commit dfb21c3c46
+2
View File
@@ -50,6 +50,7 @@ class Model:
#decorators with parameters: #decorators with parameters:
def withResource(path, binary=False): def withResource(path, binary=False):
if config.cache:
data = readfile(os.path.join(config.resourcedir, path), binary) data = readfile(os.path.join(config.resourcedir, path), binary)
def decorator(func): def decorator(func):
@@ -67,6 +68,7 @@ def withResource(path, binary=False):
return decorator return decorator
def withTemplate(path, isHTML=True): def withTemplate(path, isHTML=True):
if config.cache:
template = airspeed.Template(readfile(os.path.join(config.resourcedir, path))) template = airspeed.Template(readfile(os.path.join(config.resourcedir, path)))
def decorator(func): def decorator(func):