fixed bug in compileapp models_to_run, thanks Anthony
This commit is contained in:
1 parent
34b377522a
commit
570564b0c4
2 files changed
+8
-6
No files matched your search
+7
-5
@@ -501,8 +501,11 @@ def compile_controllers(folder):
|
||||
save_pyc(filename)
|
||||
os.unlink(filename)
|
||||
|
||||
def model_cmp(a,b):
|
||||
return cmp(a.count('.'),b.count('.')) or cmp(a,b)
|
||||
def model_cmp(a, b, sep='.'):
|
||||
return cmp(a.count(sep), b.count(sep)) or cmp(a, b)
|
||||
|
||||
def model_cmp_sep(a, b, sep=os.path.sep):
|
||||
return model_cmp(a,b,sep)
|
||||
|
||||
def run_models_in(environment):
|
||||
"""
|
||||
@@ -519,10 +522,9 @@ def run_models_in(environment):
|
||||
cpath = pjoin(folder, 'compiled')
|
||||
compiled = os.path.exists(cpath)
|
||||
if compiled:
|
||||
models = sorted(listdir(cpath, '^models[_.][\w.]+\.pyc$', 0),model_cmp)
|
||||
models = sorted(listdir(cpath, '^models[_.][\w.]+\.pyc$', 0), model_cmp)
|
||||
else:
|
||||
models = sorted(listdir(path, '^\w+\.py$', 0, sort=False),model_cmp)
|
||||
|
||||
models = sorted(listdir(path, '^\w+\.py$', 0, sort=False), model_cmp_sep)
|
||||
models_to_run = None
|
||||
for model in models:
|
||||
if response.models_to_run != models_to_run:
|
||||
|
||||
Reference in new issue
Block a user