Added followlinks=True when calling listdir
In order to solve the issue #2221, I've added followlinks=True when calling listdir() from functions compile_views(), compile_models() and compile_controllers()
This commit is contained in:
+3
-3
@@ -437,7 +437,7 @@ def compile_views(folder, skip_failed_views=False):
|
|||||||
"""
|
"""
|
||||||
path = pjoin(folder, 'views')
|
path = pjoin(folder, 'views')
|
||||||
failed_views = []
|
failed_views = []
|
||||||
for fname in listdir(path, REGEX_VIEW_PATH):
|
for fname in listdir(path, REGEX_VIEW_PATH, followlinks=True):
|
||||||
try:
|
try:
|
||||||
data = parse_template(fname, path)
|
data = parse_template(fname, path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -462,7 +462,7 @@ def compile_models(folder):
|
|||||||
Compiles all the models in the application specified by `folder`
|
Compiles all the models in the application specified by `folder`
|
||||||
"""
|
"""
|
||||||
path = pjoin(folder, 'models')
|
path = pjoin(folder, 'models')
|
||||||
for fname in listdir(path, REGEX_MODEL_PATH):
|
for fname in listdir(path, REGEX_MODEL_PATH, followlinks=True):
|
||||||
data = read_file(pjoin(path, fname))
|
data = read_file(pjoin(path, fname))
|
||||||
modelfile = 'models.'+fname.replace(os.sep, '.')
|
modelfile = 'models.'+fname.replace(os.sep, '.')
|
||||||
filename = pjoin(folder, 'compiled', modelfile)
|
filename = pjoin(folder, 'compiled', modelfile)
|
||||||
@@ -487,7 +487,7 @@ def compile_controllers(folder):
|
|||||||
Compiles all the controllers in the application specified by `folder`
|
Compiles all the controllers in the application specified by `folder`
|
||||||
"""
|
"""
|
||||||
path = pjoin(folder, 'controllers')
|
path = pjoin(folder, 'controllers')
|
||||||
for fname in listdir(path, REGEX_CONTROLLER):
|
for fname in listdir(path, REGEX_CONTROLLER, followlinks=True):
|
||||||
data = read_file(pjoin(path, fname))
|
data = read_file(pjoin(path, fname))
|
||||||
exposed = find_exposed_functions(data)
|
exposed = find_exposed_functions(data)
|
||||||
for function in exposed:
|
for function in exposed:
|
||||||
|
|||||||
Reference in New Issue
Block a user