# -*- coding: utf-8 -*-
#
-# Copyright (C) 2008-2018 EDF R&D
+# Copyright (C) 2008-2020 EDF R&D
#
# This file is part of SALOME ADAO module
#
logging.debug("-- Starting AdaoYacsSchemaCreator --")
# Check some basics variables
-if "ADAO_ROOT_DIR" not in os.environ:
- logging.fatal("You have to define ADAO_ROOT_DIR")
- sys.exit(1)
+if "ADAO_ENGINE_ROOT_DIR" not in os.environ:
+ logging.fatal("You have to define ADAO_ENGINE_ROOT_DIR")
+ sys.exit(1)
try:
- from daYacsSchemaCreator.run import *
- from daYacsSchemaCreator.help_methods import *
-except:
- logging.fatal("Import of ADAO python modules failed !" +
- "\n add ADAO python installation directory in your PYTHONPATH")
- traceback.print_exc()
- sys.exit(1)
+ import adao
+ from daYacsSchemaCreator import run
+except ImportError as e:
+ logging.fatal("\n Import of YACS schema creator module failed, the error message is:\n" +
+ "\n %s\n"%(e,) +
+ "\n Add its installation directory in your PYTHONPATH.\n")
+ sys.exit(1)
# Parse arguments
from argparse import ArgumentParser
my_parser.add_argument('yacs_schema_filename')
args = my_parser.parse_args()
-create_schema(args.config_file, args.yacs_schema_filename)
+run.create_schema_from_file(args.config_file, args.yacs_schema_filename)