82 dir_path = os.path.dirname(os.path.realpath(__file__))
83 target_conf_path = dir_path + f
'/../../target/{target}.ini'
84 if not os.path.isfile(target_conf_path):
85 raise FileNotFoundError(f
"Not found given target configuration: {target}")
89 DUMMY_SECTION =
'dummy_section'
90 with open(target_conf_path,
'r')
as f:
91 config_str = f
'[{DUMMY_SECTION}]\n' + f.read()
92 parser = oneutils.get_config_parser()
93 parser.read_string(config_str)
94 assert parser.has_section(DUMMY_SECTION)
98 assert TARGET_KEY
in parser[DUMMY_SECTION]
99 if target != parser[DUMMY_SECTION][TARGET_KEY]:
100 raise RuntimeError(
"Invalid target file.")
102 if key
in parser[DUMMY_SECTION]:
103 return parser[DUMMY_SECTION][key]
105 raise RuntimeError(f
"Not found '{key}' key in target configuration.")
109 dir_path = os.path.dirname(os.path.realpath(__file__))
112 driver_path = dir_path +
'/../' + driver
113 if os.path.isfile(driver_path)
and os.access(driver_path, os.X_OK):
117 for driver_path
in glob.glob(dir_path +
'/../../backends/**/bin/' + driver,
119 if os.path.isfile(driver_path)
and os.access(driver_path, os.X_OK):