|
|
|
|
|
|
def get_communicator(worker_id, base_port, timeout_wait): |
|
|
|
return RpcCommunicator(worker_id, base_port, timeout_wait) |
|
|
|
|
|
|
|
def executable_launcher(self, file_name, docker_training, no_graphics, args): |
|
|
|
@staticmethod |
|
|
|
def environment_launch_check(env_path): |
|
|
|
if not (glob.glob(env_path) or glob.glob(env_path + ".*")): |
|
|
|
raise UnityEnvironmentException( |
|
|
|
"Couldn't launch the {0} environment. " |
|
|
|
"Provided filename does not match any environments.".format(env_path) |
|
|
|
) |
|
|
|
file_name = ( |
|
|
|
file_name.strip() |
|
|
|
.replace(".app", "") |
|
|
|
.replace(".exe", "") |
|
|
|
.replace(".x86_64", "") |
|
|
|
.replace(".x86", "") |
|
|
|
) |
|
|
|
true_filename = os.path.basename(os.path.normpath(file_name)) |
|
|
|
logger.debug("The true file name is {}".format(true_filename)) |
|
|
|
true_filename = os.path.basename(os.path.normpath(env_path)) |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name) + ".x86_64") |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path) + ".x86_64") |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name) + ".x86") |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path) + ".x86") |
|
|
|
candidates = glob.glob(file_name + ".x86_64") |
|
|
|
candidates = glob.glob(env_path + ".x86_64") |
|
|
|
candidates = glob.glob(file_name + ".x86") |
|
|
|
candidates = glob.glob(env_path + ".x86") |
|
|
|
os.path.join( |
|
|
|
cwd, file_name + ".app", "Contents", "MacOS", true_filename |
|
|
|
) |
|
|
|
os.path.join(cwd, env_path + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(file_name + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(env_path + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(cwd, file_name + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(cwd, env_path + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(file_name + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(env_path + ".app", "Contents", "MacOS", "*") |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name + ".exe")) |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path + ".exe")) |
|
|
|
candidates = glob.glob(file_name + ".exe") |
|
|
|
candidates = glob.glob(env_path + ".exe") |
|
|
|
return launch_string |
|
|
|
|
|
|
|
|
|
|
|
def executable_launcher(self, file_name, docker_training, no_graphics, args): |
|
|
|
cwd = os.getcwd() |
|
|
|
file_name = ( |
|
|
|
file_name.strip() |
|
|
|
.replace(".app", "") |
|
|
|
.replace(".exe", "") |
|
|
|
.replace(".x86_64", "") |
|
|
|
.replace(".x86", "") |
|
|
|
) |
|
|
|
true_filename = os.path.basename(os.path.normpath(file_name)) |
|
|
|
logger.debug("The true file name is {}".format(true_filename)) |
|
|
|
launch_string = self.environment_launch_check(file_name) |
|
|
|
if launch_string is None: |
|
|
|
self._close() |
|
|
|
raise UnityEnvironmentException( |
|
|
|