From a7fc6fb910cec5f80e37071ed13e91d2493f29e8 Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Fri, 23 Sep 2016 15:15:52 +0200 Subject: [PATCH] fix the generate command --- commands/generate.py | 8 +++----- src/product.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/commands/generate.py b/commands/generate.py index 6e162d2..75193bd 100644 --- a/commands/generate.py +++ b/commands/generate.py @@ -178,15 +178,13 @@ def generate_component(config, compo, product_info, context, header, logger): return result def build_context(config, logger): - environ_info = {} products_list = [ 'KERNEL', 'GUI' ] - environ_info['products'] = config.APPLICATION.products ctxenv = src.environment.SalomeEnviron(config, src.environment.Environ(dict( os.environ)), True) ctxenv.silent = True - ctxenv.set_full_environ(logger, environ_info) + ctxenv.set_full_environ(logger, config.APPLICATION.products.keys()) dicdir = {} for p in products_list: @@ -227,7 +225,7 @@ def check_module_generator(directory=None): """ undo = False if directory is not None and directory not in sys.path: - sys.path.insert(0, dir) + sys.path.insert(0, directory) undo = True res = None @@ -237,7 +235,7 @@ def check_module_generator(directory=None): res = info[1] except ImportError: if undo: - sys.path.remove(dir) + sys.path.remove(directory) res = None return res diff --git a/src/product.py b/src/product.py index 05db3a0..4eb5c28 100644 --- a/src/product.py +++ b/src/product.py @@ -661,8 +661,8 @@ def product_is_generated(product_info): :rtype: boolean ''' return ("properties" in product_info and - "generated" in product_info.properties and - product_info.properties.generated == "yes") + "generate" in product_info.properties and + product_info.properties.generate == "yes") def get_product_components(product_info): '''Get the component list to generate with the product -- 2.39.2