From 570564b0c4c9de0990f50428c4a6bfe3d0e54bab Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 21 Oct 2013 21:30:20 -0500 Subject: [PATCH] fixed bug in compileapp models_to_run, thanks Anthony --- VERSION | 2 +- gluon/compileapp.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 27c6a4d7..461d2b6a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.7.4-stable+timestamp.2013.10.21.14.31.25 +Version 2.7.4-stable+timestamp.2013.10.21.21.29.21 diff --git a/gluon/compileapp.py b/gluon/compileapp.py index 3f0c7104..d0f5bc10 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -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: