def __init__(self, filepath):
from rez.suite import Suite<EOL>def _err(msg):<EOL><INDENT>raise RezSystemError("<STR_LIT>"<EOL>% (filepath, msg))<EOL><DEDENT>with open(filepath) as f:<EOL><INDENT>content = f.read()<EOL><DEDENT>try:<EOL><INDENT>doc = yaml.load(content)<EOL>doc = doc["<STR_LIT>"]<EOL>context_name = doc["<STR_LIT>"]<EOL>tool_name = doc["<STR_LIT>"]<EOL>prefix_char = doc.get("<STR_LIT>")<EOL><DEDENT>except YAMLError as e:<EOL><INDENT>_err(str(e))<EOL><DEDENT>suite_path = os.path.dirname(os.path.dirname(filepath))<EOL>try:<EOL><INDENT>Suite.load(suite_path)<EOL><DEDENT>except SuiteError as e:<EOL><INDENT>_err(str(e))<EOL><DEDENT>path = os.path.join(suite_path, "<STR_LIT>", "<STR_LIT>" % context_name)<EOL>context = ResolvedContext.load(path)<EOL>self._init(suite_path, context_name, context, tool_name, prefix_char)<EOL>
Create a wrapper given its executable file.