From d3345121ccf12eb5f11f4200b3b4ddc92823817c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 1 Oct 2017 08:51:30 -0300 Subject: [PATCH] Ability to set a module enabled/disabled by default by adding is_enabled() to config.py --- SConstruct | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 4fd1b86f54e..190ef93b9d4 100644 --- a/SConstruct +++ b/SConstruct @@ -189,7 +189,17 @@ for k in platform_opts.keys(): opts.Add(o) for x in module_list: - opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), True)) + module_enabled = True + tmppath = "./modules/" + x + sys.path.append(tmppath) + try: + import config + if (not config.is_enabled()): + module_enabled = False + except: + pass + sys.path.remove(tmppath) + opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), module_enabled)) opts.Update(env_base) # update environment Help(opts.GenerateHelpText(env_base)) # generate help