Don't keep files in memory when not using cache
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user