From: W. Trevor King Date: Fri, 30 Apr 2010 12:24:41 +0000 (-0400) Subject: Fixed tuple-concat error in site_init._recursive_glob_dir X-Git-Tag: v1.0~390 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=00c798e5e728cafe57cd092969fab515455d242d;p=thesis.git Fixed tuple-concat error in site_init._recursive_glob_dir Also: * Added first option to site_init.include_child_SConscripts() --- diff --git a/tex/site_cons/site_init.py b/tex/site_cons/site_init.py index d72a79d..43377b1 100644 --- a/tex/site_cons/site_init.py +++ b/tex/site_cons/site_init.py @@ -7,12 +7,17 @@ def subdirs(env, *args, **kwargs): if isinstance(subdir, SCons.Node.FS.Dir): yield subdir -def include_child_SConscripts(env, SConscript): +def include_child_SConscripts(env, SConscript, first=[]): """Get all the nested SConscripts in that may alter and pass back the environment. They may also add thesis subdependencies to that environment. """ - for subdir in subdirs(env, '*'): + sdirs = list(subdirs(env, '*')) + for subdir in reversed(first): # move first subdirs to the front + if subdir in sdirs: + sdirs.remove(subdir) + sdirs.insert(0, subdir) + for subdir in sdirs: var_sconscript_path = os.path.join(subdir.abspath, 'SConscript') src_sconscript_path = os.path.join(subdir.srcnode().abspath, @@ -44,7 +49,7 @@ def check_exec(context, executible): def _recursive_glob_dir(env, *args, **kwargs): assert len(args) > 0 glob_results = env.fs.Glob(env.subst(args[0]), *args[1:], **kwargs) - sds = list(subdirs(env, ['*']+args[1:], **kwargs)) + sds = list(subdirs(env, *(['*']+list(args[1:])), **kwargs)) return (sds, glob_results) def recursive_glob(env, *args, **kwargs):